示例#1
0
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var view        = convertView ?? _activity.LayoutInflater.Inflate(Resource.Layout.TimetableItem, parent, false);
            var from        = view.FindViewById <TextView> (Resource.Id.text_from);
            var to          = view.FindViewById <TextView>(Resource.Id.text_to);
            var lessionList = view.FindViewById <ListView>(Resource.Id.lession_list);

            var Slot    = _slotList[position];
            var adapter = new LessionItemAdaper(_activity, Slot.Lessions);

            from.Text           = Slot.From;
            to.Text             = Slot.To;
            lessionList.Adapter = adapter;
            return(view);
        }
示例#2
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;
        }
        public override View GetView(int position, View convertView, ViewGroup parent)
        {
            var view = convertView ?? _activity.LayoutInflater.Inflate (Resource.Layout.TimetableItem, parent, false);
            var from = view.FindViewById<TextView> (Resource.Id.text_from);
            var to = view.FindViewById<TextView>(Resource.Id.text_to);
            var lessionList = view.FindViewById<ListView>(Resource.Id.lession_list);

            var Slot = _slotList[position];
            var adapter = new LessionItemAdaper(_activity, Slot.Lessions);
            from.Text = Slot.From;
            to.Text = Slot.To;
            lessionList.Adapter = adapter;
            return view;
        }