public override void SelectionChanged (XuniCalendar sender, CalendarRange selectedDates)
			{
				NSDateFormatter dateFormatter = new NSDateFormatter();
				dateFormatter.DateFormat = "dd/MM/yyyy";
				maskedField.Text = dateFormatter.ToString (sender.NativeSelectedDate);
				d.IsDropDownOpen = false;
			}
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // license app with Xuni
            LicenseManager.Key = License.Key;

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

            // get chart from view
            calendar = FindViewById<XuniCalendar>(Resource.Id.calendar);

            // for vertical scrolling set Orientation
            calendar.Orientation = CalendarOrientation.Vertical;

            // set maximum selected days
            calendar.MaxSelectionCount = 14;

            // change appearance
            calendar.DayOfWeekBackgroundColor = System.Drawing.Color.Transparent.ToArgb();
            calendar.DayOfWeekTextColor = System.Drawing.Color.LightGray.ToArgb();

            calendar.DaySlotLoading += Calendar_DaySlotLoading;

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

            //button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
        }
        void InitUISettings()
        {
            #region xuni calendar
            calendar                   = FindViewById <XuniCalendar>(Resource.Id.calendar);
            calendar.Orientation       = CalendarOrientation.Vertical;
            calendar.MaxSelectionCount = 1;

            // change appearance
            calendar.DayOfWeekBackgroundColor = System.Drawing.Color.Transparent.ToArgb();
            calendar.DayOfWeekTextColor       = System.Drawing.Color.LightGray.ToArgb();
            calendar.TodayTextColor           = System.Drawing.Color.Red.ToArgb();
            calendar.SelectionBackgroundColor = GROUP_COLOR;

            calendar.DaySlotLoading   += CalendarDaySlotLoading;
            calendar.SelectionChanged += CalendarSelectionChanged;
            #endregion

            lblTSB  = FindViewById <TextView>(Resource.Id.lblTSB);
            lblCTL  = FindViewById <TextView>(Resource.Id.lblCTL);
            lblATL  = FindViewById <TextView>(Resource.Id.lblATL);
            lblLoad = FindViewById <TextView>(Resource.Id.lblLoad);

            FindViewById <TextView>(Resource.Id.lblNoEvent).SetTextColor(GROUP_COLOR);

            lblTSB.SetTextColor(GROUP_COLOR);
            lblCTL.SetTextColor(GROUP_COLOR);
            lblATL.SetTextColor(GROUP_COLOR);
            lblLoad.SetTextColor(GROUP_COLOR);

            noEventsContent            = FindViewById <LinearLayout>(Resource.Id.noEventsContent);
            noEventsContent.Visibility = ViewStates.Gone;

            FindViewById(Resource.Id.ActionReload).Click += (sender, e) => ReloadEvents();
            FindViewById(Resource.Id.ActionToday).Click  += (sender, e) => GotoToday();
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // license app with Xuni
            LicenseManager.Key = License.Key;

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

            // get chart from view
            calendar = FindViewById <XuniCalendar>(Resource.Id.calendar);

            // for vertical scrolling set Orientation
            calendar.Orientation = CalendarOrientation.Vertical;

            // set maximum selected days
            calendar.MaxSelectionCount = 14;

            // change appearance
            calendar.DayOfWeekBackgroundColor = System.Drawing.Color.Transparent.ToArgb();
            calendar.DayOfWeekTextColor       = System.Drawing.Color.LightGray.ToArgb();

            calendar.DaySlotLoading += Calendar_DaySlotLoading;

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

            //button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
        }
Esempio n. 5
0
            public override void SelectionChanged(XuniCalendar sender, CalendarRange selectedDates)
            {
                NSDateFormatter dateFormatter = new NSDateFormatter();

                dateFormatter.DateFormat = "dd/MM/yyyy";
                maskedField.Text         = dateFormatter.ToString(sender.NativeSelectedDate);
                d.IsDropDownOpen         = false;
            }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			dateFormatter = new NSDateFormatter ();

			calendar = new XuniCalendar();
			calendar.HeaderBackgroundColor = UIColor.White;
			calendar.Hidden = true;
			calendar.SelectionChanged+=(object sender, SelectionChangedEventArgs e) => 
			{
				dateFormatter.DateFormat = "M/d/yyyy";
				dateLabel.Text = "The date " + dateFormatter.StringFor(e.SelectedDates.StartDate) + " was selected.";
				calendar.Hidden = true;
				if (calendar.Hidden == true) {
						this.View.BackgroundColor = UIColor.White;
						this.NavigationController.NavigationBar.BarTintColor = UIColor.White;
				}

			};

			pickBtn = new UIButton(UIButtonType.System);
			pickBtn.SetTitle("Pick a date", UIControlState.Normal);
			pickBtn.TouchUpInside+=(object sender, EventArgs e) => 
			{
				calendar.Hidden = !calendar.Hidden;
				if (calendar.Hidden == false) {
					this.View.BackgroundColor = UIColor.Gray;
					this.NavigationController.NavigationBar.BarTintColor = UIColor.LightGray;
				}
				else
				{
					this.View.BackgroundColor = UIColor.White;
					this.NavigationController.NavigationBar.BarTintColor = UIColor.White;
				}
			};

			dateLabel = new UILabel();
			dateLabel.Text = "";

			view = new UIView();
			view.BackgroundColor  = UIColor.White;
			view.UserInteractionEnabled = true;
			view.Layer.CornerRadius = 4;

			this.View.Add(pickBtn);
			this.View.Add(dateLabel);
			this.View.Add(view);
			this.View.Add(calendar);


		}
Esempio n. 7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            dateFormatter = new NSDateFormatter();

            calendar = new XuniCalendar();
            calendar.HeaderBackgroundColor = UIColor.White;
            calendar.Hidden            = true;
            calendar.SelectionChanged += (object sender, SelectionChangedEventArgs e) =>
            {
                dateFormatter.DateFormat = "M/d/yyyy";
                dateLabel.Text           = "The date " + dateFormatter.StringFor(e.SelectedDates.StartDate) + " was selected.";
                calendar.Hidden          = true;
                if (calendar.Hidden == true)
                {
                    this.View.BackgroundColor = UIColor.White;
                    this.NavigationController.NavigationBar.BarTintColor = UIColor.White;
                }
            };

            pickBtn = new UIButton(UIButtonType.System);
            pickBtn.SetTitle("Pick a date", UIControlState.Normal);
            pickBtn.TouchUpInside += (object sender, EventArgs e) =>
            {
                calendar.Hidden = !calendar.Hidden;
                if (calendar.Hidden == false)
                {
                    this.View.BackgroundColor = UIColor.Gray;
                    this.NavigationController.NavigationBar.BarTintColor = UIColor.LightGray;
                }
                else
                {
                    this.View.BackgroundColor = UIColor.White;
                    this.NavigationController.NavigationBar.BarTintColor = UIColor.White;
                }
            };

            dateLabel      = new UILabel();
            dateLabel.Text = "";

            view = new UIView();
            view.BackgroundColor        = UIColor.White;
            view.UserInteractionEnabled = true;
            view.Layer.CornerRadius     = 4;

            this.View.Add(pickBtn);
            this.View.Add(dateLabel);
            this.View.Add(view);
            this.View.Add(calendar);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            dropdown    = new XuniDropDown(this);
            header      = new XuniMaskedTextView(this);
            header.Mask = "00/00/0000";

            calendar                   = new XuniCalendar(this);
            dropdown.Header            = header;
            dropdown.Dropdown          = calendar;
            dropdown.DropDownHeight    = 400;
            dropdown.Animated          = true;
            calendar.SelectionChanged += SelectionChanged;

            this.SetContentView(dropdown);
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            dropdown = new XuniDropDown(this);
		    header = new XuniMaskedTextView(this);
		    header.Mask="00/00/0000";

		    calendar = new XuniCalendar(this);
		    dropdown.Header=header;
		    dropdown.Dropdown=calendar;
			dropdown.DropDownHeight = 400;
		    dropdown.Animated=true;
            calendar.SelectionChanged += SelectionChanged;

		    this.SetContentView(dropdown);
           
         }
Esempio n. 10
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            DropDown.DropDownHeight    = 300;
            DropDown.DropDownWidth     = DropDown.Frame.Size.Width + 30;
            DropDown.DropDownDirection = XuniDropDownDirection.ForceBelow;
            DropDown.IsAnimated        = true;
            d = DropDown;

            maskedField                 = new XuniMaskedTextField();
            maskedField.Mask            = "00/00/0000";
            maskedField.BackgroundColor = UIColor.Clear;
            maskedField.BorderStyle     = UITextBorderStyle.None;
            DropDown.Header             = maskedField;

            calendar              = new XuniCalendar();
            calendar.Delegate     = new Mydelegate();
            DropDown.DropDownView = calendar;
        }
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();

			DropDown.DropDownHeight = 300;
			DropDown.DropDownWidth = DropDown.Frame.Size.Width + 30;
			DropDown.DropDownDirection = XuniDropDownDirection.ForceBelow;
			DropDown.IsAnimated = true;
			d = DropDown;

			maskedField = new XuniMaskedTextField();
			maskedField.Mask = "00/00/0000";
			maskedField.BackgroundColor = UIColor.Clear;
			maskedField.BorderStyle = UITextBorderStyle.None;
			DropDown.Header = maskedField;

			calendar = new XuniCalendar ();
			calendar.Delegate = new Mydelegate();
			DropDown.DropDownView = calendar;

		}
Esempio n. 12
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            LicenseManager.Key = License.Key;
            SetContentView(Resource.Layout.FirstView);

            am = GetSystemService(AlarmService).JavaCast <AlarmManager>();

            string date;

            for (int i = 0; i < ViewModel.getRecordsCount(); i++)
            {
                date = ViewModel.getRecordDate(i);
                records.Add(new CalRecord(date.Split('/')[0],
                                          date.Split('/')[1],
                                          date.Split('/')[2]));
            }

            // get chart from view
            calendar     = FindViewById <XuniCalendar>(Resource.Id.calendar);
            button       = FindViewById <Button>(Resource.Id.invisibleButton);
            SoonViewName = FindViewById <TextView>(Resource.Id.SoonEventName);
            SoonViewTime = FindViewById <TextView>(Resource.Id.SoonEventTime);
            SoonViewMore = FindViewById <TextView>(Resource.Id.SoonEventMore);
            if (ViewModel.record != null)
            {
                SoonViewName.Text = ViewModel.record.Name;
                string c = ":";
                if (ViewModel.record.Min < 10)
                {
                    c = ":0";
                }
                SoonViewTime.Text = ViewModel.record.RecordDate + " " + ViewModel.record.Hour + c + ViewModel.record.Min;
                SoonViewMore.Text = ViewModel.record.More;
            }


            // for vertical scrolling set Orientation
            calendar.Orientation    = CalendarOrientation.Horizontal;
            calendar.FirstDayOfWeek = Com.GrapeCity.Xuni.Calendar.DayOfWeek.Monday;

            // set maximum selected days
            calendar.MaxSelectionCount = 1;

            calendar.SelectionChanged += (object sender, CalendarSelectionChangedEventArgs e) =>
            {
                bool a = false;
                for (int i = 0; i < records.Count; i++)
                {
                    date = ViewModel.getRecordDate(i);
                    if (calendar.SelectedDate.Day.ToString() == date.Split('/')[0] &&
                        calendar.SelectedDate.Month.ToString() == date.Split('/')[1] &&
                        calendar.SelectedDate.Year.ToString() == date.Split('/')[2])
                    {
                        a = true;
                        showPopupMenu(i);
                    }
                }

                if (!a)
                {
                    ViewModel.DayModel   = calendar.SelectedDate.Day;
                    ViewModel.MonthModel = calendar.SelectedDate.Month;
                    ViewModel.YearModel  = calendar.SelectedDate.Year;
                    ViewModel.MyButtonCommand.Execute();
                }
            };

            // change appearance
            calendar.DaySlotLoading          += Calendar_DaySlotLoading;
            calendar.SelectionBackgroundColor = Android.Graphics.Color.White;

            toolbar = FindViewById <Toolbar>(Resource.Id.toolbar);
            SetActionBar(toolbar);

            ActionBar.Title = "Календарь";
        }