Ejemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var layoutCreator = new LayoutCreation();
            var scrollView    = layoutCreator.CreateBaiscScrollView(this);
            var linearLayout  = layoutCreator.CreateBasicLinearLayout(this);

            var day = Intent.GetStringExtra("DayNumber") ?? "No day";

            linearLayout.AddView(layoutCreator.CreateSimpleButton(this, Color.White, Color.SteelBlue, "Day: " + day, null,
                                                                  false));

            var timeButton = layoutCreator.CreateResourceButton(this, Color.White, "Time-ordered Table");
            var personalTimeTableButton = layoutCreator.CreateResourceButton(this, Color.White, "Personal Timetable");
            var stageButton             = layoutCreator.CreateResourceButton(this, Color.White, "Stage-ordered Table");

            linearLayout.AddView(stageButton);
            linearLayout.AddView(personalTimeTableButton);
            linearLayout.AddView(timeButton);


            timeButton.Click += delegate
            {
                var timeActivity = new Intent(this, typeof(TimeOrderedActivity));
                timeActivity.PutExtra("EventName", Intent.GetStringExtra("EventName"));
                timeActivity.PutExtra("Day", day);
                StartActivity(timeActivity);
            };

            personalTimeTableButton.Click += delegate
            {
                var timeActivity = new Intent(this, typeof(PersonalTimetableActivity));
                timeActivity.PutExtra("EventName", Intent.GetStringExtra("EventName"));
                timeActivity.PutExtra("Day", day);
                StartActivity(timeActivity);
            };

            stageButton.Click += delegate
            {
                var timeActivity = new Intent(this, typeof(StageOrderedActivity));
                timeActivity.PutExtra("EventName", Intent.GetStringExtra("EventName"));
                timeActivity.PutExtra("Day", day);
                StartActivity(timeActivity);
            };

            scrollView.AddView(linearLayout);

            SetContentView(scrollView);
        }
Ejemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var uniqueDays = new DocsReader().CreateIdList().Where(d => d.EventName == Intent.GetStringExtra("EventName")).Select(t => t.Day).Distinct().OrderBy(e => e);

            var layoutCreator = new LayoutCreation();
            var scrollView    = layoutCreator.CreateBaiscScrollView(this);
            var linearLayout  = layoutCreator.CreateBasicLinearLayout(this);

            linearLayout.AddView(layoutCreator.CreateResourceButton(this, Color.White, "Select a day:"));
            var lineupButton = layoutCreator.CreateResourceButton(this, Color.Red, "Full Line-up:");

            foreach (var day in uniqueDays)
            {
                var stageButton = layoutCreator.CreateResourceButton(this, Color.Cyan, "Day: " + day);
                linearLayout.AddView(stageButton);

                stageButton.Click += delegate
                {
                    var selectedDayActivity = new Intent(this, typeof(SelectedDayActivity));
                    selectedDayActivity.PutExtra("EventName", Intent.GetStringExtra("EventName"));
                    selectedDayActivity.PutExtra("DayNumber", day.ToString());
                    StartActivity(selectedDayActivity);
                };
            }

            lineupButton.Click += delegate
            {
                var lineupActivity = new Intent(this, typeof(LineupActivity));
                lineupActivity.PutExtra("EventName", Intent.GetStringExtra("EventName"));
                StartActivity(lineupActivity);
            };

            linearLayout.AddView(lineupButton);
            scrollView.AddView(linearLayout);
            SetContentView(scrollView);
        }
Ejemplo n.º 3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var events = new DocsReader().CreateIdList().Select(t => t.EventName).Distinct().OrderBy(e => e);

            var layoutCreator = new LayoutCreation();
            var scrollView    = layoutCreator.CreateBaiscScrollView(this);

            if (events.Any())
            {
                var linearLayout = layoutCreator.CreateBasicLinearLayout(this);

                linearLayout.AddView(layoutCreator.CreateSimpleButton(this, Color.White, Color.SteelBlue, "Select an event:", null, true));

                foreach (var eventname in events)
                {
                    var stageButton = layoutCreator.CreateResourceButton(this, Color.Red, eventname);

                    linearLayout.AddView(stageButton);

                    stageButton.Click += delegate
                    {
                        var dayActivity = new Intent(this, typeof(DayActivity));
                        dayActivity.PutExtra("EventName", eventname);
                        StartActivity(dayActivity);
                    };
                }
                scrollView.AddView(linearLayout);
            }
            else
            {
                scrollView.AddView(layoutCreator.CreateErrorLayout(this));
            }

            SetContentView(scrollView);
        }