Exemple #1
0
        private void ShowDropoffDialog()
        {
            Android.Support.V7.App.AlertDialog alertDialog = new Android.Support.V7.App.AlertDialog.Builder(this).Create();
            alertDialog.SetMessage(GetString(Resource.String.dropoff_dialog_text));
            alertDialog.SetButton((int)DialogButtonType.Positive, GetString(Resource.String.dropoff_dialog_positive_text), (s, e) =>
            {
                FetchRoute(GetLastKnownLocation(), points[0]);
                points.RemoveAt(0);
            });
            alertDialog.SetButton((int)DialogButtonType.Negative, GetString(Resource.String.dropoff_dialog_negative_text), (s, e) =>
            {
                // Do nothing
            });

            alertDialog.Show();
        }
        void ShowDropoffDialog()
        {
            var alertDialog = new Android.Support.V7.App.AlertDialog.Builder(this).Create();

            alertDialog.SetMessage(GetString(Resource.String.dropoff_dialog_text));
            alertDialog.SetButton(
                (int)DialogButtonType.Positive,
                GetString(Resource.String.dropoff_dialog_positive_text), (sender, e) =>
            {
                var userPoint = Point.FromLngLat(lastKnownLocation.Longitude, lastKnownLocation.Latitude);
                navigationView.FinishNavigationView();
                navigationView.StartNavigation(SetupOptions(userPoint));
            });

            alertDialog.SetButton(
                (int)DialogButtonType.Negative,
                GetString(Resource.String.dropoff_dialog_negative_text),
                (sender, e) => { });

            alertDialog.Show();
        }
Exemple #3
0
        private void FabFunctions(int v)
        {
            string     projectName = "", start = "", end = "", percent = "", work = "", duration = "";
            EditText   mProjectName, mStart, mEnd, mPercent, mWork, mDuration;
            DatePicker mDatePicker;
            DateTime   today;



            switch (v)
            {
            case 1:
                addItems.Click += delegate {
                    View view = LayoutInflater.Inflate(Resource.Layout.builder_add_project, null);
                    Android.App.AlertDialog builder = new Android.App.AlertDialog.Builder(this).Create();
                    builder.SetView(view);


                    mProjectName = view.FindViewById <EditText>(Resource.Id.builderProjectName);
                    mStart       = view.FindViewById <EditText>(Resource.Id.builderStart);
                    mEnd         = view.FindViewById <EditText>(Resource.Id.builderEnd);
                    mPercent     = view.FindViewById <EditText>(Resource.Id.builderProgress);
                    mWork        = view.FindViewById <EditText>(Resource.Id.builderWork);
                    mDuration    = view.FindViewById <EditText>(Resource.Id.builderDuration);


                    builder.SetCanceledOnTouchOutside(false);
                    builder.SetButton2("Submit", async delegate
                    {
                        projectName = mProjectName.Text;
                        start       = mStart.Text;
                        end         = mEnd.Text;
                        percent     = mPercent.Text + " %";
                        work        = mWork.Text + " hrs";
                        duration    = mDuration.Text + " day(s)";
                        await addListItems(projectName, start, end, percent, work, duration);
                    });
                    builder.SetButton3("Cancel", delegate { builder.Dismiss(); });


                    mStart.Click += (sender, e) => {
                        Android.Support.V7.App.AlertDialog builder2 = new Android.Support.V7.App.AlertDialog.Builder(this).Create();
                        View view2 = LayoutInflater.Inflate(Resource.Layout.date_picker, null);
                        builder2.SetView(view2);

                        mDatePicker = FindViewById <DatePicker>(Resource.Id.datePicker);

                        builder2.SetButton(-1, "OK", delegate {
                            //mStart.Text = mDatePicker.Month + "/" + mDatePicker.DayOfMonth + "/" + mDatePicker.Year;
                        });
                        builder2.SetButton(-2, "Cancel", delegate { });
                        builder2.Show();
                    };



                    builder.Show();
                };



                //addItems.Click += async delegate { await addListItems(projectName, start, end, percent, work, duration); };
                break;
            }
        }