Esempio n. 1
0
        public View GetView(Activity activity)
        {
            View        view     = activity.LayoutInflater.Inflate(Resource.Layout.TimetableDay, null);
            var         dayTitle = view.FindViewById <TextView>(Resource.Id.day_text);
            ListView    list     = view.FindViewById <ListView>(Resource.Id.timetable_list);
            ImageButton btnBack  = view.FindViewById <ImageButton>(Resource.Id.previousDay);
            ImageButton btnNext  = view.FindViewById <ImageButton>(Resource.Id.nextDay);

            btnBack.Visibility = show_back ? ViewStates.Visible : ViewStates.Invisible;
            btnNext.Visibility = show_next ? ViewStates.Visible : ViewStates.Invisible;



            if (timetableDay.Weekday.Length < 1)
            {
                dayTitle.Text = "Spezial";

                //dishDay.SetBackgroundDrawable(context.Resources.GetDrawable(Resource.Drawable.whitey));
                List <lessionText> lessionTexts = new List <lessionText>();
                foreach (Lession lession in timetableDay.Lessions)
                {
                    foreach (CourseAllocation allocation in lession.CourseAllocations)
                    {
                        var room = "";
                        foreach (RoomAllocation r in allocation.RoomAllocations)
                        {
                            room += r.Roomnumber + ";";
                        }
                        lessionTexts.Add(new lessionText(lession.Name, lession.LecturersShortVersion, room.TrimEnd(';')));
                    }
                }
                var adapter = new LessionItemAdaper(activity, lessionTexts);
                list.Adapter = adapter;
            }
            else
            {
                dayTitle.Text = timetableDay.Weekday;

                //dishDay.SetBackgroundDrawable(context.Resources.GetDrawable(Resource.Drawable.whitey));
                var adapter = new TimetableItemAdapter(activity, timetableDay.Lessions);
                list.Adapter = adapter;
            }
            return(view);
        }
        public View GetView(Activity activity)
        {
            View view = activity.LayoutInflater.Inflate(Resource.Layout.TimetableDay, null);
            var dayTitle = view.FindViewById<TextView>(Resource.Id.day_text);
            ListView list = view.FindViewById<ListView>(Resource.Id.timetable_list);
            ImageButton btnBack = view.FindViewById<ImageButton>(Resource.Id.previousDay);
            ImageButton btnNext = view.FindViewById<ImageButton>(Resource.Id.nextDay);
            btnBack.Visibility = show_back ? ViewStates.Visible : ViewStates.Invisible;
            btnNext.Visibility = show_next ? ViewStates.Visible : ViewStates.Invisible;

            if (timetableDay.Weekday.Length < 1)
            {
                dayTitle.Text = "Spezial";

                //dishDay.SetBackgroundDrawable(context.Resources.GetDrawable(Resource.Drawable.whitey));
                List<lessionText> lessionTexts = new List<lessionText>();
                foreach (Lession lession in timetableDay.Lessions)
                {
                    foreach (CourseAllocation allocation in lession.CourseAllocations)
                    {
                        var room = "";
                        foreach (RoomAllocation r in allocation.RoomAllocations)
                        {
                            room += r.Roomnumber + ";";
                        }
                        lessionTexts.Add(new lessionText(lession.Name, lession.LecturersShortVersion, room.TrimEnd(';')));
                    }
                }
                var adapter = new LessionItemAdaper(activity, lessionTexts);
                list.Adapter = adapter;
            }
            else
            {

                dayTitle.Text = timetableDay.Weekday;

                //dishDay.SetBackgroundDrawable(context.Resources.GetDrawable(Resource.Drawable.whitey));
                var adapter = new TimetableItemAdapter(activity, timetableDay.Lessions);
                list.Adapter = adapter;

            }
            return view;
        }