public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var view = base.OnCreateView(inflater, container, savedInstanceState); var dateButton = view.FindViewById <Button>(Resource.Id.TaskReminderDate); var timeButton = view.FindViewById <Button>(Resource.Id.TaskReminderTime); dateButton.Click += (sender, args) => { var currentDate = DateTime.Parse(ViewModel.FullText, ViewModel.TextProvider.CurrentCulture); var dialog = new DatePickerDialog(Activity, Resource.Style.DatePickerDialogCustom, this, currentDate.Year, currentDate.Month - 1, currentDate.Day); dialog.DatePicker.SetMinDate(ViewModel.MinDate); dialog.Show(); }; timeButton.Click += (sender, args) => { var currentTime = DateTime.Parse(ViewModel.FullText, ViewModel.TextProvider.CurrentCulture); bool is24HourFormat = DateFormat.Is24HourFormat(Activity); var dialog = new TimePickerDialog(Activity, Resource.Style.TimePickerDialogCustom, this, currentTime.Hour, currentTime.Minute, is24HourFormat); dialog.Show(); }; return(view); }
private void CreateDialog() { if (_Dialog != null) { return; } _Dialog = new TimePickerDialog(AndroidContext, TimeSelected, _TimePickerCell.Time.Hours, _TimePickerCell.Time.Minutes, DateFormat.Is24HourFormat(AndroidContext) ); var title = new TextView(AndroidContext) { Gravity = Android.Views.GravityFlags.Center, Text = string.IsNullOrEmpty(_PopupTitle) ? "Select Time" : _PopupTitle, }; title.SetBackgroundColor(_TimePickerCell.Prompt.BackgroundColor.ToAndroid()); title.SetTextColor(_TimePickerCell.Prompt.TitleColor.ToAndroid()); title.SetPadding(10, 10, 10, 10); _Dialog.SetCustomTitle(title); _Dialog.SetCanceledOnTouchOutside(true); _Dialog.DismissEvent += (sender, e) => { title.Dispose(); _Dialog.Dispose(); _Dialog = null; }; _Dialog.Show(); }
protected void EditTime() { if (timeEditing) { return; } timeEditing = true; var context = Context; if (context == null) { Android.Util.Log.Warn("TimeElement", "No Context for Edit"); timeEditing = false; return; } var val = Value.HasValue ? Value.Value : DateTime.UtcNow; var timePicker = new TimePickerDialog(context, OnTimeSet, val.Hour, val.Minute, DateFormat.Is24HourFormat(context)); timePicker.DismissEvent += ((sender, args) => { timeEditing = false; }); timePicker.Show(); }
/// <summary> /// Displays the time picker for setting the alarm time /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AlarmTime_Click(object sender, EventArgs e) { hideSoftKeyboard(); TimePickerDialog tpd = new TimePickerDialog(this, tdpCallback, DateTime.Now.Hour, DateTime.Now.Minute, true); tpd.Show(); }
private void ShowDT(object sender, bool reset) { if (reset) { calender = Calendar.GetInstance(Java.Util.TimeZone.Default); baseModel.Year = calender.Get(CalendarField.Year); baseModel.Month = calender.Get(CalendarField.Month) + 1; baseModel.Day = calender.Get(CalendarField.DayOfMonth); baseModel.Hour = calender.Get(CalendarField.HourOfDay); baseModel.Minute = calender.Get(CalendarField.Minute); } baseModel.CurrentView = false; if (sender == datePick) { datePickerDialog = new DatePickerDialog(this, OnDateShow, baseModel.Year, baseModel.Month - 1, baseModel.Day); datePickerDialog.Show(); } else if (sender == timePick) { timePickerDialog = new TimePickerDialog(this, OnTimeShow, baseModel.Hour, baseModel.Minute, true); if (baseModel.TimePickerBundler != null) { timePickerDialog.OnRestoreInstanceState(baseModel.TimePickerBundler); } timePickerDialog.Show(); } }
private void B2_Click(object sender, EventArgs e) { DateTime time = DateTime.Now; TimePickerDialog dialog = new TimePickerDialog(this, OnTimeSet, time.Hour, time.Minute, true); dialog.Show(); }
public override View GetView(int position, View convertView, ViewGroup parent) { var view = context.LayoutInflater.Inflate(Resource.Layout.WorkTimeListItem, null); var item = GetItem(position); view.FindViewById <TextView> (Resource.Id.txtDayOrOddEven).Text = item.Item1; var btnWorkTimeFromValue = view.FindViewById <Button> (Resource.Id.btnWorkTimeFromValue); btnWorkTimeFromValue.Text = item.Item2.ToString("t"); btnWorkTimeFromValue.Click += (object sender, EventArgs e) => { doctor.chooseNwtType = item.Item3; var timepickDialog = new TimePickerDialog(context, tpCallBack, item.Item2.Hour, item.Item2.Minute, true); timepickDialog.SetTitle(item.Item1); timepickDialog.Show(); }; var btnWorkTimeTillValue = view.FindViewById <Button> (Resource.Id.btnWorkTimeTillValue); btnWorkTimeTillValue.Text = item.Item4.ToString("t"); btnWorkTimeTillValue.Click += (object sender, EventArgs e) => { doctor.chooseNwtType = item.Item5; var timepickDialog = new TimePickerDialog(context, tpCallBack, item.Item4.Hour, item.Item4.Minute, true); timepickDialog.SetTitle(item.Item1); timepickDialog.Show(); }; return(view); }
private void StartTimeDialog_Click(object sender, EventArgs e) { DateTime currently = DateTime.Now; TimePickerDialog dialog = new TimePickerDialog(this, SetStartTime, currently.Hour, currently.Minute, true); dialog.Show(); }
private void _editOutsideActivityStartTimeEditText_Click(object sender, EventArgs e) { bool is24HourFormat = false; using TimePickerDialog timePicker = new TimePickerDialog(this, this, outsideActivity.StartTime.Hour, outsideActivity.StartTime.Minute, is24HourFormat); timePicker.Show(); }
void CreateDialog() { if (_dialog == null) { bool is24HourFormat = DateFormat.Is24HourFormat(_context); _dialog = new TimePickerDialog(_context, TimeSelected, _TimePickerCell.Time.Hours, _TimePickerCell.Time.Minutes, is24HourFormat); var title = new TextView(_context); if (!string.IsNullOrEmpty(_title)) { title.Gravity = Android.Views.GravityFlags.Center; title.SetPadding(10, 10, 10, 10); title.Text = _title; _dialog.SetCustomTitle(title); } _dialog.SetCanceledOnTouchOutside(true); _dialog.DismissEvent += (ss, ee) => { title.Dispose(); _dialog.Dispose(); _dialog = null; }; _dialog.Show(); } }
private void TimeButton_Click(object sender, EventArgs e) { DateTime today = DateTime.Today; TimePickerDialog timePickerDialog = new TimePickerDialog(this, OnTimeSet, today.Hour, today.Minute, true); timePickerDialog.Show(); }
private void MTxtTransactionTime_Click(object sender, EventArgs e) { selectedHourOfDay = Convert.ToInt32(GetSelectedTime(mTxtTransactionTime.Text, DateTime.Now.ToString("d/MMM/yyyy")).ToString("HH")); selectedMinute = Convert.ToInt32(GetSelectedTime(mTxtTransactionTime.Text, DateTime.Now.ToString("d/MMM/yyyy")).ToString("mm")); TimePickerDialog tpd = new TimePickerDialog(this, TimeListener, selectedHourOfDay, selectedMinute, false); tpd.Show(); }
private void ShowTimePicker() { if (dialog == null) { dialog = new TimePickerDialog(Forms.Context, this, DateTime.Now.Hour, DateTime.Now.Minute, true); } dialog.Show(); }
private void ShowTimePicker() { if (dialog == null) { dialog = new TimePickerDialog(Context, 3, OnTimeSet, Element.Time.Hours, Element.Time.Minutes, true); } dialog.Show(); }
/// <summary> /// Catches the event when the date is set /// </summary> /// <param name="sender">The sender</param> /// <param name="e">The arguments</param> private void DatePickerDialog_DateSet(object sender, DatePickerDialog.DateSetEventArgs e) { saveDate = e.Date; TimePickerDialog timePickerDialog = new TimePickerDialog( this.Context, OnTimeSet, DateTime.Now.TimeOfDay.Hours, DateTime.Now.TimeOfDay.Minutes, true); timePickerDialog.SetTitle(Resource.String.picktime_text); timePickerDialog.Show(); }
public void ShowPicker() { TextBase.CurrentFocus?.Blur(true); var now = Time ?? DateTime.Now; _timePicker = new TimePickerDialog(DroidFactory.MainActivity, OnTimeChanged, now.Hour, now.Minute, Android.Text.Format.DateFormat.Is24HourFormat(DroidFactory.MainActivity)); _timePicker.Show(); }
private void ShowTimePicker() { if (_dialog == null) { _dialog = new TimePickerDialogEx(this.Element, Forms.Context, this, DateTime.Now.Hour, DateTime.Now.Minute); } _dialog.Show(); }
private void ShowTimePicker() { if (dialog == null) { dialog = new TimePickerDialog(Forms.Context, this, Element.Time.Hours, Element.Time.Minutes, true); } dialog.Show(); }
public void ShowTimeDialog(Object sender, EventArgs e) { TimePickerDialog mTimePicker; mTimePicker = new TimePickerDialog(this, Android.Resource.Style.ThemeHoloLightDialog, this, hour, minute, false); mTimePicker.SetTitle("Select Time"); mTimePicker.Show(); }
private void TimeEditText_Click(object sender, EventArgs e) { DateTime currentTime = DateTime.Now; TimePickerDialog dialog = new TimePickerDialog(Activity, 2, (sender_, args) => { string amPm = (args.HourOfDay > 12 ? "PM" : "AM"); View.FindViewById <EditText>(Resource.Id.ResTime).Text = (args.HourOfDay > 12 ? Return12HourNumber(args.HourOfDay) : args.HourOfDay.ToString()) + " " + args.Minute + " " + amPm; }, currentTime.Hour, currentTime.Minute, false); dialog.Show(); }
private void EndTimeName_Click(object sender, EventArgs e) { TimePickerDialog timePicker = new TimePickerDialog(mContext, EndTimePickerCallback, EndTime.Get(CalendarField.HourOfDay), EndTime.Get(CalendarField.Minute), false); timePicker.Show(); }
public void OnClick(global::Android.Views.View v) { var dialog = new TimePickerDialog(Context, new EventHandler <TimePickerDialog.TimeSetEventArgs>(OnTimeSet), _control.Time.Hours, _control.Time.Minutes, _control.Is24Hour); dialog.SetCustomTitle(new TextView(Context) { Visibility = ViewStates.Gone }); dialog.Show(); }
private void UpdateWorkTimeList() { LinearLayout mainll = FindViewById <LinearLayout> (Resource.Id.lstDD); mainll.RemoveAllViewsInLayout(); //lstWorkTime.RemoveAllViewsInLayout(); workTimeItems.Clear(); if (doctor.wtKind == WorkTime_Kind.Days) { workTimeItems.Add(new Tuple <String, DateTime, WorkTime_Type, DateTime, WorkTime_Type>("Понедельник", doctor.wtDays.Mon_From, WorkTime_Type.Mon_From, doctor.wtDays.Mon_Till, WorkTime_Type.Mon_Till)); workTimeItems.Add(new Tuple <String, DateTime, WorkTime_Type, DateTime, WorkTime_Type>("Вторник ", doctor.wtDays.Tue_From, WorkTime_Type.Tue_From, doctor.wtDays.Tue_Till, WorkTime_Type.Tue_Till)); workTimeItems.Add(new Tuple <String, DateTime, WorkTime_Type, DateTime, WorkTime_Type>("Среда ", doctor.wtDays.Wed_From, WorkTime_Type.Wed_From, doctor.wtDays.Wed_Till, WorkTime_Type.Wed_Till)); workTimeItems.Add(new Tuple <String, DateTime, WorkTime_Type, DateTime, WorkTime_Type>("Четверг ", doctor.wtDays.Thu_From, WorkTime_Type.Thu_From, doctor.wtDays.Thu_Till, WorkTime_Type.Thu_Till)); workTimeItems.Add(new Tuple <String, DateTime, WorkTime_Type, DateTime, WorkTime_Type>("Пятница ", doctor.wtDays.Fri_From, WorkTime_Type.Fri_From, doctor.wtDays.Fri_Till, WorkTime_Type.Fri_Till)); // workTimeItems.Add(new Tuple<String, DateTime, WorkTime_Type, DateTime, WorkTime_Type>("Суббота ", doctor.wtDays.Sut_From, WorkTime_Type.Sut_From, doctor.wtDays.Sut_Till, WorkTime_Type.Sut_Till)); // workTimeItems.Add(new Tuple<String, DateTime, WorkTime_Type, DateTime, WorkTime_Type>("Воскресенье", doctor.wtDays.Sun_From, WorkTime_Type.Sun_From, doctor.wtDays.Sun_Till, WorkTime_Type.Sun_Till)); } else { workTimeItems.Add(new Tuple <String, DateTime, WorkTime_Type, DateTime, WorkTime_Type>("Четная дата ", doctor.wtOddEven.Even_From, WorkTime_Type.Even_From, doctor.wtOddEven.Even_Till, WorkTime_Type.Even_Till)); workTimeItems.Add(new Tuple <String, DateTime, WorkTime_Type, DateTime, WorkTime_Type>("Нечетная дата", doctor.wtOddEven.Odd_From, WorkTime_Type.Odd_From, doctor.wtOddEven.Odd_Till, WorkTime_Type.Odd_Till)); } //lstWorkTime.Adapter = new WorkTimeListAdapter(this, workTimeItems, doctor, TimePickerCallback); for (int i = 0; i <= workTimeItems.Count - 1; i++) { var view = this.LayoutInflater.Inflate(Resource.Layout.WorkTimeListItem, null); var item = workTimeItems[i]; view.FindViewById <TextView> (Resource.Id.txtDayOrOddEven).Text = item.Item1; var btnWorkTimeFromValue = view.FindViewById <Button> (Resource.Id.btnWorkTimeFromValue); btnWorkTimeFromValue.Text = item.Item2.ToString("t"); btnWorkTimeFromValue.Click += (object sender, EventArgs e) => { doctor.chooseNwtType = item.Item3; var timepickDialog = new TimePickerDialog(this, TimePickerCallback, item.Item2.Hour, item.Item2.Minute, true); timepickDialog.SetTitle(item.Item1); timepickDialog.Show(); }; var btnWorkTimeTillValue = view.FindViewById <Button> (Resource.Id.btnWorkTimeTillValue); btnWorkTimeTillValue.Text = item.Item4.ToString("t"); btnWorkTimeTillValue.Click += (object sender, EventArgs e) => { doctor.chooseNwtType = item.Item5; var timepickDialog = new TimePickerDialog(this, TimePickerCallback, item.Item4.Hour, item.Item4.Minute, true); timepickDialog.SetTitle(item.Item1); timepickDialog.Show(); }; mainll.AddView(view); } }
void ShowTimePicker() { if (_dialog == null) { _dialog = new TimePickerDialog(CurrentContext, this, Element.Time.Hours, Element.Time.Minutes, true); } _dialog.UpdateTime(Element.Time.Hours, Element.Time.Minutes); _dialog.Show(); }
public void Init() { mDatePickerDialog = new DatePickerDialog(this, this, ViewModel.EndBookingDateTime.Year, ViewModel.EndBookingDateTime.Month - 1, ViewModel.EndBookingDateTime.Day); mTimePickerDialog = new TimePickerDialog(this, this, ViewModel.EndBookingDateTime.Hour, ViewModel.EndBookingDateTime.Minute, true); etDate = FindViewById <TextView>(Resource.Id.etDate); etHour = FindViewById <TextView>(Resource.Id.etHour); mSeekBar = FindViewById <SeekBar>(Resource.Id.seekBar1); mSeekBar.Touch += (sender, args) => { if (args.Event.Action == MotionEventActions.Up) { if (mSeekBar.Progress != mCurrentProgress) { mCurrentProgress = mSeekBar.Progress; ViewModel.HandleValueChanged(); args.Handled = true; return; } } args.Handled = false; }; mCurrentProgress = 0; etDate.Click += (sender, args) => { mDatePickerDialog.UpdateDate(ViewModel.EndBookingDateTime.Year, ViewModel.EndBookingDateTime.Month - 1, ViewModel.EndBookingDateTime.Day); mDatePickerDialog.Show(); }; etHour.Click += (sender, args) => { mTimePickerDialog.UpdateTime(ViewModel.EndBookingDateTime.Hour, ViewModel.EndBookingDateTime.Minute); mTimePickerDialog.Show(); }; locationManager = (LocationManager)GetSystemService(LocationService); bool GPSEnable = DetectLocationService(); var _isGooglePlayServicesInstalled = IsGooglePlayServicesInstalled(); if (_isGooglePlayServicesInstalled) { // pass in the Context, ConnectionListener and ConnectionFailedListener apiClient = new GoogleApiClientBuilder(this, this, this) .AddApi(LocationServices.API).Build(); // generate a location request that we will pass into a call for location updates locRequest = new LocationRequest(); } else { Log.Error("OnCreate", "Google Play Services is not installed"); Toast.MakeText(this, ViewModel.SharedTextSource.GetText("GGPlayNotInstalledText"), ToastLength.Long).Show(); } }
private void TimePickerButton_Click(object sender, EventArgs e) { var timePicker = new TimePickerDialog( this, TimePickerCallback, DateTime.Now.Hour, DateTime.Now.Minute, true); timePicker.Show(); }
private void PoBtnOnClick(object sender, EventArgs eventArgs) { var btn = sender as Button; if (btn != null) { _lastPoclikedId = btn.Id; var timePicker = new TimePickerDialog(Activity, CallBackPo, 18, 00, true); timePicker.Show(); } }
private void StartTimeName_Click(object sender, EventArgs e) { TimePickerDialog timePicker = new TimePickerDialog( con, StartTimePickerCallback, startTime.Get(CalendarField.HourOfDay), startTime.Get(CalendarField.Minute), false); timePicker.Show(); }
private void ShowTimePicker() { if (dialog == null) { TimeSpan time = (TimeSpan)this.Element.GetValue(Xamarin.Forms.TimePicker.TimeProperty); dialog = new TimePickerDialog(Forms.Context, this, time.Hours, time.Minutes, true); } dialog.Show(); }
public void OnDateSet(DatePicker view, int year, int month, int dayOfMonth) { _partyTime = new DateTime(year, month, dayOfMonth); var hourOfDay = DateTime.UtcNow.Hour; var minute = DateTime.UtcNow.Minute; var time = new TimePickerDialog(this, this, hourOfDay, minute, true); time.Show(); }