protected override async void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            switch (IoC.UserInfo.Employee.PrivledgeLevel)
            {
                case "Admin":
                    {
                        SetContentView(Resource.Layout.Calendar_Admin);
                        eventItemAdapter = new EventItemAdapter();
                        recipientListItemAdapter = new RecipientListItemAdapter();
                        break;
                    }
                case "Moderator":
                    {
                        SetContentView(Resource.Layout.Calendar_Moderator);
                        eventItemAdapter = new EventItemAdapter();
                        recipientListItemAdapter = new RecipientListItemAdapter();
                        break;
                    }
                default:
                    {
                        SetContentView(Resource.Layout.Calendar_User);
                        eventItemAdapter = new EventItemAdapter();
                        recipientListItemAdapter = new RecipientListItemAdapter();
                        break;
                    }
            }

            _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar);
            _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout);
            _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view);
            ToolbarCreator toolbarCreator = new ToolbarCreator();
            toolbarCreator.setupToolbar(_supporttoolbar, _drawer, _navigationview, Resource.String.calendar_view, this);

            var nextYear = DateTime.Now.AddYears(1);
            var lastYear = DateTime.Now.AddYears(-1);
            calendar = FindViewById<CalendarPickerView>(Resource.Id.calendar_view);
            calendar.Init(lastYear, nextYear)
                .WithSelectedDate(DateTime.Now)
                .InMode(CalendarPickerView.SelectionMode.Single);

            await RefreshView();
            myEventList = recipientListItemAdapter.getEventsByEmployeeID(IoC.UserInfo.EmployeeID, eventItemAdapter);
            myEventList = filterEvents();

            setHighlightDates(calendar);

            calendar.DateSelected += delegate
            {
                IoC.selectedDate = calendar.SelectedDate;
                Intent intent = new Intent(this, typeof(CalendarListActivity));
                StartActivity(intent);
            };
        }
        private void setHighlightDates(CalendarPickerView calendar)
        {
            List<DateTime> dates = new List<DateTime>();

            foreach (EventItem item in myEventList)
            {
                dates.Add(item.EventDate);
            }
            calendar.HighlightDates(dates);
        }
Ejemplo n.º 3
0
 private void WeekdaysOnlySelection(object sender, CalendarPickerView.DateSelectableFilterEventArgs e)
 {
     e.IsDateSelectable = e.Date.DayOfWeek != DayOfWeek.Saturday && e.Date.DayOfWeek != DayOfWeek.Sunday;
 }
Ejemplo n.º 4
0
 private void ShowCalendarInDialog(string title, int layoutResId)
 {
     dialogView = (CalendarPickerView)LayoutInflater.Inflate(layoutResId, null, false);
     theDialog = new AlertDialog.Builder(this)
         .SetTitle(title)
         .SetView(dialogView)
         .SetNeutralButton("Dismiss", (sender, e) => theDialog.Dismiss())
         .Create();
     theDialog.ShowEvent += delegate
     {
         dialogView.FixDialogDimens();
     };
     theDialog.Show();
 }
Ejemplo n.º 5
0
 void ICalendarCellDecorator.Decorate(CalendarCellView cellView, Date date)
 {
     Decorate(cellView, CalendarPickerView.GetDate(date));
 }