Ejemplo n.º 1
0
        public static TimePickerFragment NewInstance(Action <DateTime> onTimeSelected)
        {
            TimePickerFragment frag = new TimePickerFragment();

            frag.timeSelectedHandler = onTimeSelected;
            return(frag);
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            FindViewById();
            var slider = FindViewById <Xamarin.RangeSlider.RangeSliderControl>(Resource.Id.sliderPrice);

            _sliderPrice.SetSelectedMinValue(50);
            _sliderPrice.SetSelectedMaxValue(200);
            FSlider();

            SetSupportActionBar(mToolbar);
            mLeftDataSet = new List <string>();
            mLeftDataSet.Add("Развлечения");
            mLeftDataSet.Add("Аккаунт");
            mLeftDataSet.Add("О нас");
            mLeftAdapter        = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, mLeftDataSet);
            mLeftDrawer.Adapter = mLeftAdapter;

            SupportActionBar.SetHomeButtonEnabled(true);
            SupportActionBar.SetDisplayShowTitleEnabled(true);


            mLeftDrawer.ChoiceMode = ChoiceMode.Single;
            mLeftDrawer.ItemClick += (sender, e) =>
            {
                string s_item = mLeftDrawer.GetItemAtPosition(e.Position).ToString();
                if (s_item == "Развлечения")
                {
                    var intent = new Intent(this, typeof(InformationViews));
                    StartActivity(intent);
                    //intent.PutExtra("DateBefore", Convert.ToInt32(DateBefore));
                    //intent.PutExtra("DateAfter", Convert.ToInt32(DateAfter));
                    intent.PutExtra("minMoney", minMoney);
                    intent.PutExtra("maxMoney", maxMoney);
                }
                else
                {
                    if (s_item == "Аккаунт")
                    {
                        Toast.MakeText(this, "Тут будет авторизация!", ToastLength.Short).Show();
                    }
                    else
                    {
                        Toast.MakeText(this, "Тут будет информация о нас!", ToastLength.Short).Show();
                    }
                }
            };

            DateButton.Click += (s, e) =>
            {
                DatePickerFragment frag = DatePickerFragment.NewInstance(delegate(DateTime time)
                {
                    Date = time;
                    Toast.MakeText(this, $"{Date.ToLongDateString()}", ToastLength.Long).Show();
                    DateButton.Text = Date.Date.ToString();
                });
                frag.Show(FragmentManager, DatePickerFragment.TAG);
            };
            time_before.Click += delegate
            {
                TimePickerFragment frag = TimePickerFragment.NewInstance(
                    delegate(DateTime time)
                {
                    Time_b = time;
                    Toast.MakeText(this, $"{Time_b.Hour}", ToastLength.Long).Show();
                });

                frag.Show(FragmentManager, TimePickerFragment.TAG);
            };

            time_after.Click += delegate
            {
                TimePickerFragment frag = TimePickerFragment.NewInstance(
                    delegate(DateTime time)
                {
                    Time_a = time;
                    Toast.MakeText(this, $"{Time_a.Hour}", ToastLength.Long).Show();
                });

                frag.Show(FragmentManager, TimePickerFragment.TAG);
            };
            toEnt.Click += (e, s) =>
            {
                var intent = new Intent(this, typeof(InformationViews));
                StartActivity(intent);
                //intent.PutExtra("DateBefore", Convert.ToInt32(DateBefore));
                //intent.PutExtra("DateAfter", Convert.ToInt32(DateAfter));
                intent.PutExtra("minMoney", minMoney);
                intent.PutExtra("maxMoney", maxMoney);
            };
        }