Ejemplo n.º 1
0
 public override Dialog OnCreateDialog(Bundle savedInstanceState)
 {
     DateTime currently = DateTime.Now;
     DatePickerDialog dialog = new DatePickerDialog(Activity, this, currently.Year, currently.Month,
                                                    currently.Day);
     return dialog;
 }
        void HandleDateSet(object sender, DatePickerDialog.DateSetEventArgs e)
        {
            _date = e.Date;

            var dateText = FindViewById<EditText> (Resource.Id.datePickerText);
            dateText.Text = _date.ToString ("d");
        }
        private void EdtStartDate_Click(object sender, EventArgs e)
        {
            DateTime         d         = DateTime.Now;
            DatePickerDialog StartDate = new Android.App.DatePickerDialog(this.Activity, StartDateSet, d.Year, d.Month - 1, d.Day);

            StartDate.Show();
        }
        public override Dialog OnCreateDialog(Bundle savedState)
        {
            var dialog = new Android.App.DatePickerDialog(_context, _listener, _date.Year, _date.Month - 1, _date.Day);

            dialog.DatePicker.Tag = _tag;
            return(dialog);
        }
 public BaiBiaoSamplePagerAdapter(List<string> Items, Activity mactivity, DatePickerDialog.IOnDateSetListener listener)
     : base()
 {
     items = Items.ToList ();
     mActivity = mactivity;
     mListener = listener;
     //mBtnListener = mbtnListener;
 }
Ejemplo n.º 6
0
 public override Dialog OnCreateDialog(Bundle savedInstanceState)
 {
     int year = DateTime.Now.Year;
     int month = DateTime.Now.Month;
     int day = DateTime.Now.Day;
     DatePickerDialog dialog = new DatePickerDialog (nn_context, nn_listener, year, month, day);
     dialog.DatePicker.MaxDate = TimeManager.MillisecondsTimestamp ();
     dialog.DatePicker.MinDate= -2208898420000;
     return dialog;
 }
Ejemplo n.º 7
0
    public override Dialog OnCreateDialog(Bundle savedInstanceState)
    {
        DateTime         currently = DateTime.Now;
        DatePickerDialog dialog    = new DatePickerDialog(Activity,
                                                          this,
                                                          currently.Year,
                                                          currently.Month - 1,
                                                          currently.Day);

        return(dialog);
    }
Ejemplo n.º 8
0
        void HandleDateSet(object sender, DatePickerDialog.DateSetEventArgs e)
        {
            if (e.Date <= DateTime.Now.Date) {
                Toast.MakeText (this, Resources.GetString (Resource.String.expirationDateError), ToastLength.Short).Show ();
                customDate = DateTime.Today.AddDays (1);
            } else
                customDate = e.Date;

            selectedTime = (int) (customDate - DateTime.Now).TotalMinutes;
            textDate.Text = customDate.ToShortDateString ();
            textDate.Visibility = ViewStates.Visible;
        }
        public SamplePagerAdapter(List<string> Items, Activity mactivity, DatePickerDialog.IOnDateSetListener listener)
            : base()
        {
            items = Items.ToList ();

            //items.Add("    手动报警     ");
            //items.Add("     自动报警     ");
            //items.Add("     监管报警    ");

            mActivity = mactivity;
            mListener = listener;
        }
Ejemplo n.º 10
0
 void OnDateSet(object sender, DatePickerDialog.DateSetEventArgs e)
 {
     this.date[actualId] = e.Date;
     switch (actualId)
     {
         case 0:
             dataPoczatekText.Text = date[0].ToShortDateString();
             break;
         case 1:
             dataKoniecText.Text = date[1].ToShortDateString();
             break;
     }
 }
Ejemplo n.º 11
0
        public static DatePickerDialog Build(Activity activity, DatePromptConfig config)
        {
            var dateTime = config.SelectedDate ?? DateTime.Now;
            var dialog = new DatePickerDialog(
                activity,
                (sender, args) => { },
                dateTime.Year,
                dateTime.Month - 1,
                dateTime.Day
            );
            dialog.SetCancelable(false);

            if (!String.IsNullOrWhiteSpace(config.Title))
                dialog.SetTitle(config.Title);

            if (config.MinimumDate != null)
                dialog.DatePicker.MinDate = config.MinimumDate.Value.ToUnixTimestamp();

            if (config.MaximumDate != null)
                dialog.DatePicker.MaxDate = config.MaximumDate.Value.ToUnixTimestamp();

            if (config.IsCancellable)
            {
                dialog.SetButton(
                    (int) DialogButtonType.Negative,
                    new SpannableString(config.CancelText),
                    (sender, args) => config
                        .OnAction?
                        .Invoke(new DatePromptResult(
                            false,
                            dialog.DatePicker.DateTime.Date
                        ))
                );
            }
            dialog.SetButton(
                (int)DialogButtonType.Positive,
                new SpannableString(config.OkText),
                (sender, args) => config
                    .OnAction?
                    .Invoke(new DatePromptResult(
                        true,
                        dialog.DatePicker.DateTime.Date
                    ))
            );
            return dialog;
        }
Ejemplo n.º 12
0
 public static DatePickerDialog ShowDatePickerDialog(Context ctx, int textView)
 {
     try
     {
         var cal = Calendar.GetInstance(TimeZone.Default);
         var listener = new OnDateSetListener(textView);
         var datePicker = new DatePickerDialog(ctx, listener,
             cal.Get(Calendar.Year),
             cal.Get(Calendar.Month),
             cal.Get(Calendar.DayOfMonth));
         datePicker.SetCancelable(false);
         datePicker.Show();
     }
     catch (Exception ex)
     {
         ShowDialog(ctx, "An error occured while showing Date Picker\n\n Error Details:\n" + ex, "Exception");
     }
     return null;
 }
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);

			// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Main);

			// Get our button from the layout resource,
			// and attach an event to it
			Button btnChooseDate = FindViewById<Button> (Resource.Id.btnChooseDate);
			lblDateDisplay = FindViewById<TextView> (Resource.Id.lblDateDisplay);

			date = DateTime.Today;

			btnChooseDate.Click += delegate {
				DatePickerDialog setDate = new DatePickerDialog(this,onDateSet, date.Year,date.Month-1,date.Day);
				setDate.Show();
			};

			SetDisplayDate ();
		}
Ejemplo n.º 14
0
 // the event received when the user "sets" the date in the dialog
 void OnDateSet(object sender, DatePickerDialog.DateSetEventArgs e)
 {
     DateTime current = DateValue;
     DateValue = new DateTime(e.Date.Year, e.Date.Month, e.Date.Day, current.Hour, current.Minute, 0);
 }
Ejemplo n.º 15
0
 void HandleDateSet(object sender, DatePickerDialog.DateSetEventArgs e)
 {
     _date = e.Date;
     EditText trxdate =  FindViewById<EditText> (Resource.Id.newinv_date);
     trxdate.Text = _date.ToString ("dd-MM-yyyy");
 }
Ejemplo n.º 16
0
 void OnDateSet(object sender, DatePickerDialog.DateSetEventArgs e)
 {
     this.date = e.Date;
     dataText.Text = date.ToShortDateString();
 }
Ejemplo n.º 17
0
 void HandleDateSet(object sender, DatePickerDialog.DateSetEventArgs e)
 {
     _date = e.Date;
     txtInvDate.Text = _date.ToString ("dd-MM-yyyy");
 }
 public override Dialog OnCreateDialog(Bundle savedState)
 {
     var dialog = new DatePickerDialog(context, listener, date.Year, date.Month - 1, date.Day);
     return dialog;
 }
Ejemplo n.º 19
0
 void OnDateSet(object sender, DatePickerDialog.DateSetEventArgs e)
 {
     this.date = e.Date;
     UpdateDisplay();
 }
Ejemplo n.º 20
0
 public DatePickerFragment(Context context,DatePickerDialog.IOnDateSetListener listener)
 {
     nn_context=context;
     nn_listener = listener;
 }
Ejemplo n.º 21
0
		protected override Dialog OnCreateDialog (int id)
		{
			switch (id) {
			case Start_DATE_DIALOG_ID:
				{
					var datePicker = new DatePickerDialog (this, OnStartDateSet, StartDate.Year, StartDate.Month - 1, StartDate.Day); 
					datePicker.DatePicker.MaxDate = Utility.SetMaxDate (0);
					return datePicker;
				}
			}
			return null;

		}
 public override Dialog OnCreateDialog(Bundle savedState)
 {
     DatePickerDialog dialog = new Android.App.DatePickerDialog(_context, _listener, _date.Year, _date.Month - 1, _date.Day);
     return dialog;
 }
		private void ShowDialog(int id)
		{
			DatePickerDialog dialog;

			var packageName =Application.Context.PackageName.ToString();
			int position = VacationInfoCreateTabsFragment._viewPager.CurrentItem;
			int viewId =_container.Context.Resources.GetIdentifier ("view_"+position, "id" ,packageName);

			View currentView = _container.FindViewById (viewId);

			if (id == 0) {
				Button ItemStartDateBtn = currentView.FindViewById<Button> (Resource.Id.ItemStartDateBtn);
				DateTime time = DateTime.Parse (ItemStartDateBtn.Text);

				dialog = new DatePickerDialog (_container.Context, HandleStartDateSet, time.Year, time.Month - 1, time.Day);
			} else {
				Button ItemEndDateBtn = currentView.FindViewById<Button> (Resource.Id.ItemEndDateBtn);
				DateTime time = DateTime.Parse (ItemEndDateBtn.Text);

				dialog = new DatePickerDialog (_container.Context, HandleEndDateSet, time.Year, time.Month - 1, time.Day);
			}
			dialog.DatePicker.MinDate =(long)(DateTime.Now - new DateTime(1970, 1, 1)).TotalMilliseconds;
			dialog.Show();
		}
		private void HandleEndDateSet (object sender, DatePickerDialog.DateSetEventArgs e)
		{
			var packageName =Application.Context.PackageName.ToString();
			int position = VacationInfoCreateTabsFragment._viewPager.CurrentItem;
			int viewId =_container.Context.Resources.GetIdentifier ("view_"+position, "id" ,packageName);

			View currentView = _container.FindViewById (viewId);

			Button ItemEndDateBtn = currentView.FindViewById<Button> (Resource.Id.ItemEndDateBtn);
			ItemEndDateBtn.Text = e.Date.ToString ("d");

			this.NotifyDataSetChanged ();
		}
Ejemplo n.º 25
0
		// the event received when the user "sets" the date in the dialog
		void OnStartDateSet (object sender, DatePickerDialog.DateSetEventArgs e)
		{
			StartDatePicker.Text = e.Date.ToString ("dd'/'MM'/'yyyy");
			this.StartDate = e.Date;
			InitData ();
		}
Ejemplo n.º 26
0
 void OnDateSet2(object sender, DatePickerDialog.DateSetEventArgs e)
 {
     EditText tod = FindViewById<EditText> (Resource.Id.trxdateto);
     tod.Text = e.Date.ToString("dd-MM-yyyy");
 }
Ejemplo n.º 27
0
		protected override void OnCreate (Bundle bundle)
		{
			base.OnCreate (bundle);
					// Set our view from the "main" layout resource
			SetContentView (Resource.Layout.Physical);
			EditText txtFeet = FindViewById<EditText> (Resource.Id.txtFeet);
			TextView lblDateDisplay = FindViewById<TextView> (Resource.Id.lblDateDisplay);
			EditText txtInches = FindViewById<EditText> (Resource.Id.txtInches);
			EditText txtLbs = FindViewById<EditText> (Resource.Id.txtLbs);
			Button btnLifeStyle = FindViewById<Button> (Resource.Id.btnLifeStyle);
			Button btnChooseDate = FindViewById<Button> (Resource.Id.btnChooseDate);
			RadioButton rbMale = FindViewById<RadioButton> (Resource.Id.rbMale);
			RadioButton rbFemale = FindViewById<RadioButton> (Resource.Id.rbFemale);
			RadioGroup rbGender = FindViewById<RadioGroup> (Resource.Id.rbGender);


			btnChooseDate.Click += delegate {
				DatePickerDialog setDate = new DatePickerDialog(this,onDateSet, _UserBday.Year,_UserBday.Month-1,_UserBday.Day);
				setDate.Show();
			};

			SetDisplayDate ();
			btnLifeStyle.Click += delegate {

				double dFeet = -1;
				double dInches = -1;
				double dLbs = -1;
				if (double.TryParse(txtFeet.Text, out dFeet))
				{
					if (double.TryParse(txtInches.Text, out dInches))
					{
						if (double.TryParse(txtLbs.Text, out dLbs)){

							//openlifestyleView
//							_User.BirthDate = _UserBday;
//							_User.Height = (12.0 * dFeet) + dInches;
//							_User.Weight = dLbs;
							((ControllClass)Application)._oUser.BirthDate = _UserBday;
							((ControllClass)Application)._oUser.Height = (12.0 * dFeet) + dInches;
							((ControllClass)Application)._oUser.Weight = dLbs;
							rbGender.CheckedChange += delegate {
								if(rbMale.Checked){
									((ControllClass)Application)._oUser.Sex = eGender.male;
									//_User.Sex = eGender.male;
								}else if (rbFemale.Checked){
									((ControllClass)Application)._oUser.Sex = eGender.female;
									//	_User.Sex = eGender.female;
								}
								//((ControllClass)Application)._oUser = _User;
								StartActivity(typeof(LifeStyle));
							};


						}
					}
				}

//				if ((dFeet == -1)||(dInches == -1)||(dLbs == -1))
//				{
//									}

			};					
		}
 public DatePickerDialogFragment(Context context, DateTime date, DatePickerDialog.IOnDateSetListener listener)
 {
     this.context = context;
     this.date = date;
     this.listener = listener;
 }
 public DatePickerDialogFragment(Context context, DateTime date, DatePickerDialog.IOnDateSetListener listener)
 {
     _context = context;
     _date = date;
     _listener = listener;
 }
		void mDateSetListener (object sender, DatePickerDialog.DateSetEventArgs e)
		{
			mYear = e.Year;
			mMonth = e.MonthOfYear;
			mDay = e.DayOfMonth;
			UpdateDisplay ();
		}
Ejemplo n.º 31
0
		public void ShowShareFileDatePicker (string pathToNewFileShare)
		{
			homeActivity.HideProgressDialog ();

			var selectedExpirationDate = DateTime.Now.AddDays (7);//Selectie standaard op 7 dagen na vandaag
			var picker = new DatePickerDialog (homeActivity, (object sender, DatePickerDialog.DateSetEventArgs e) => {
				selectedExpirationDate = e.Date;

				if (selectedExpirationDate.Date <= DateTime.Now.Date) {
					homeActivity.HideProgressDialog ();
					Toast.MakeText (Android.App.Application.Context, "Gekozen vervaldatum moet na vandaag zijn. Probeer het a.u.b. opnieuw.", ToastLength.Long).Show ();
				} else {
					ThreadPool.QueueUserWorkItem (async o => {
						PublicUrl createdPublicUrl = await DataLayer.Instance.CreatePublicFileShare (pathToNewFileShare, selectedExpirationDate);

						if (createdPublicUrl != null) {
							//Open e-mail intent
							var emailIntent = new Intent (Android.Content.Intent.ActionSend);

							string bodyText = "Mijn gedeelde bestand: \n" +
								createdPublicUrl.publicUri + "\n \n" +
								"Deze link is geldig tot: " + selectedExpirationDate.ToString ("dd-MM-yyyy");

							emailIntent.PutExtra (Android.Content.Intent.ExtraSubject, "Publieke URL naar gedeeld LocalBox bestand");
							emailIntent.PutExtra (Android.Content.Intent.ExtraText, bodyText);
							emailIntent.SetType ("message/rfc822");
							homeActivity.RunOnUiThread (() => {
								homeActivity.HideProgressDialog ();

								homeActivity.StartActivity (emailIntent);
							});
						} else {
							homeActivity.HideProgressDialog ();
							Toast.MakeText (Android.App.Application.Context, "Bestand delen mislukt", ToastLength.Short).Show ();
						}
					});
				}


			}, selectedExpirationDate.Year, selectedExpirationDate.Month - 1, selectedExpirationDate.Day);
			picker.SetTitle ("Selecteer vervaldatum:");
			picker.Show ();
		}
Ejemplo n.º 32
0
		void onDateSet(object sender, DatePickerDialog.DateSetEventArgs e)
		{
			_UserBday = e.Date;
			SetDisplayDate ();
		}
Ejemplo n.º 33
0
 void HandleEndDate (object sender, DatePickerDialog.DateSetEventArgs e)
 {
     this.Poll.PollEndDate = e.Date;
     _EndDateButton.Text = this.Poll.PollStartDate.Value.ToString ("d");
 }