コード例 #1
0
        public void ShowTimetableView(StudentTimetable timetable, Day startDay)
        {
            if (startDay == null)
            {
                if (StartDay != null)
                {
                    startDay = StartDay;
                }
                else
                {
                    startDay = Day.Today;
                }
            }
            if (timetable == null)
            {
                if (Timetable != null)
                {
                    timetable = Timetable;
                }
                else
                {
                    return;
                }
            }

            TimetableView timetableView = new TimetableView(Activity, timetable, startDay, this);

            SetContentView(timetableView);

            IsLoading = false;
            Timetable = timetable;
            StartDay  = startDay;

            ShowOptionMenu(true);

            var settings = Activity.GetSharedPreferences(PreferencesFile, FileCreationMode.Private);

            var studentIdHistory = JsonValue.Parse(settings.GetString(StudentIdHistory, "[]")).Cast <int>().ToList();

            studentIdHistory.Insert(0, Timetable.Student.Id);

            var settingsEditor = settings.Edit();

            settingsEditor.PutInt(StudentId, Timetable.Student.Id);
            //settingsEditor.PutString(StudentIdHistory, new JsonArray(studentIdHistory).ToString());
            settingsEditor.Commit();

            Day currentDay = startDay;

            for (int i = 0; i < PreloadDays; i++)
            {
                Timetable.UpdateIfNeeded(currentDay, (day, events) => {}, e => Console.WriteLine(e));
                currentDay = MultiDayView.GetFirstValidDay(currentDay, 1);
            }
        }
コード例 #2
0
        public TimetableView(Context context, Timetable timetable, Day day, TimetableFragment ttf) : base(context)
        {
            Orientation = Orientation.Horizontal;

            hourLayout             = new LinearLayout(context);
            hourLayout.Orientation = Orientation.Vertical;
            AddView(hourLayout);

            /*
             * Deze is er alleen om de uren op de goede plaats te krijgen
             */
            dummyDateView = new DateTitleView(context, null);
            hourLayout.AddView(dummyDateView);

            hourView = new HourView(context, TimeLayout.DefaultStartHour, TimeLayout.DefaultEndHour);
            hourLayout.AddView(hourView);

            dayView = new MultiDayView(context, timetable, day, hourView, ttf);
            hourView.AddHourHeightListener(dayView);
            AddView(dayView);
        }
コード例 #3
0
 public DayScrollView(Context context, MultiDayView mdv) : base(context)
 {
     HorizontalScrollBarEnabled  = false;
     HorizontalFadingEdgeEnabled = false;
     MultiDayView = mdv;
 }