protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var artistsList = new DocsReader().CreateIdList().Where(d => d.EventName == Intent.GetStringExtra("EventName")).Where(e => e.Day == Convert.ToInt32(Intent.GetStringExtra("Day"))).OrderBy(e => e.Stage).ThenBy(t => t.SetStartTime).ToList(); var stages = artistsList.Select(t => t.Stage).Distinct(); var compareDate = DateTime.Parse("07:00:00.000"); foreach (var artist in artistsList.ToList()) { if (artist.SetStartTime < compareDate) { var artist2 = artist; artistsList.Remove(artist); artistsList.Add(artist2); } } var layoutCreator = new LayoutCreation(); var scrollView = layoutCreator.CreateBaiscScrollView(this); var linearLayout = layoutCreator.CreateBasicLinearLayout(this); foreach (var stage in stages) { linearLayout.AddView(layoutCreator.CreateSimpleButton(this, Color.White, Color.SteelBlue, stage, null, true)); foreach (var artist in artistsList.Where(a => a.Stage == stage)) { var artistText = new TextView(this) { Text = artist.Name + " :", TextSize = 21 }; artistText.SetTextColor(Color.White); var artistTime = new TextView(this) { Text = artist.SetStartTime.ToShortTimeString() + " - " + artist.SetEndTime.ToShortTimeString(), TextSize = 20 }; artistTime.SetTextColor(Color.Silver); var breakLine = new TextView(this) { Text = "-------------------------------" }; breakLine.SetTextColor(Color.Black); linearLayout.AddView(artistText); linearLayout.AddView(artistTime); linearLayout.AddView(breakLine); } } scrollView.AddView(linearLayout); SetContentView(scrollView); }
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); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var layoutCreator = new LayoutCreation(); var scrollView = layoutCreator.CreateBaiscScrollView(this); var linearLayout = layoutCreator.CreateBasicLinearLayout(this); var artistsList = new DocsReader().CreateIdList().Where(d => d.EventName == Intent.GetStringExtra("EventName")).Where(y => y.Day == Convert.ToInt32(Intent.GetStringExtra("Day"))).OrderBy(a => a.SetStartTime.Hour).ToList(); var CompareDate = DateTime.Parse("07:00:00.000"); foreach (var artist in artistsList.ToList()) { if (artist.SetStartTime < CompareDate) { var artist2 = artist; artistsList.Remove(artist); artistsList.Add(artist2); } } for (var artistId = 0; artistId < artistsList.Count(); artistId++) { if (artistId != 0) { if (artistsList.ElementAt(artistId).Stage != artistsList.ElementAt(artistId - 1).Stage) { linearLayout.AddView(layoutCreator.CreateSimpleButton(this, Color.White, Color.SteelBlue, artistsList.ElementAt(artistId).Stage, null, true)); } } else { linearLayout.AddView(layoutCreator.CreateSimpleButton(this, Color.White, Color.SteelBlue, artistsList.ElementAt(artistId).Stage, null, true)); } var artistDetails = artistsList.ElementAt(artistId).Name + ": " + artistsList.ElementAt(artistId).SetStartTime.ToShortTimeString() + " - " + artistsList.ElementAt(artistId).SetEndTime.ToShortTimeString(); linearLayout.AddView(layoutCreator.CreateSimpleButton(this, Color.White, Color.SteelBlue, artistDetails, 21, false)); } scrollView.AddView(linearLayout); SetContentView(scrollView); }
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); }
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); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var txtHandler = new PersonalTxtHandler(); var artists = new DocsReader().CreateLineupIdList().OrderBy(e => e.Stage); var stages = artists.Select(t => t.Stage).Distinct(); var layoutCreator = new LayoutCreation(); var scrollView = layoutCreator.CreateBaiscScrollView(this); var linearLayout = layoutCreator.CreateBasicLinearLayout(this); var checkBoxlist = new List <CheckBox>(); foreach (var stage in stages) { linearLayout.AddView(layoutCreator.CreateSimpleButton(this, Color.White, Color.SteelBlue, stage, null, true)); foreach (var artist in artists.Where(e => e.Stage == stage)) { var artistButton = new CheckBox(this) { TextSize = 23, Text = artist.Name }; var savedList = txtHandler.ReadTxtFile(); if (savedList.Contains(artistButton.Text)) { artistButton.Checked = true; } checkBoxlist.Add(artistButton); linearLayout.AddView(artistButton); } } var saveButton = layoutCreator.CreateSimpleButton(this, Color.White, Color.SteelBlue, "Save", null, true); saveButton.Click += delegate { var selectedArtistsList = new List <string>(); foreach (var checkBox in checkBoxlist) { if (checkBox.Checked) { selectedArtistsList.Add(checkBox.Text); } } txtHandler.WriteTxtFile(selectedArtistsList); new AlertDialog.Builder(this) .SetPositiveButton("Ok", (sender, args) => { // User pressed yes }) .SetMessage("Saved succesfully!") .SetTitle("Saved") .Show(); }; linearLayout.AddView(saveButton); scrollView.AddView(linearLayout); SetContentView(scrollView); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var layoutCreator = new LayoutCreation(); var scrollView = layoutCreator.CreateBaiscScrollView(this); var linearLayout = layoutCreator.CreateBasicLinearLayout(this); var artistsList = new DocsReader().CreateIdList().Where(d => d.EventName == Intent.GetStringExtra("EventName")).Where(y => y.Day == Convert.ToInt32(Intent.GetStringExtra("Day"))).OrderBy(a => a.SetStartTime.Hour).ToList(); var txtHandler = new PersonalTxtHandler(); var selectedArtistList = txtHandler.ReadTxtFile(); if (selectedArtistList.Count != 0) { var actualList = new List <Artist>(); foreach (var artist in selectedArtistList) { var list = artistsList.Where(t => t.Name == artist); foreach (var item in list) { actualList.Add(item); } } var artistlist2 = actualList.OrderBy(t => t.SetStartTime).ToList(); var compareDate = DateTime.Parse("07:00:00.000"); foreach (var artist in artistlist2.ToList()) { if (artist.SetStartTime < compareDate) { var artist2 = artist; artistlist2.Remove(artist); artistlist2.Add(artist2); } } for (var artistId = 0; artistId < artistlist2.Count(); artistId++) { if (artistId != 0) { if (artistlist2.ElementAt(artistId).Stage != artistlist2.ElementAt(artistId - 1).Stage) { linearLayout.AddView(layoutCreator.CreateSimpleButton(this, Color.White, Color.SteelBlue, artistlist2.ElementAt(artistId).Stage, null, true)); } } //Only creates first artists as it needs a first to be able to compare stages above ^ else { linearLayout.AddView(layoutCreator.CreateSimpleButton(this, Color.White, Color.SteelBlue, artistlist2.ElementAt(artistId).Stage, null, true)); } var artistsDetails = artistlist2.ElementAt(artistId).Name + ": " + artistlist2.ElementAt(artistId).SetStartTime.ToShortTimeString() + " - " + artistlist2.ElementAt(artistId).SetEndTime.ToShortTimeString(); linearLayout.AddView(layoutCreator.CreateSimpleButton(this, Color.White, Color.DarkGray, artistsDetails, 19, false)); } scrollView.AddView(linearLayout); } SetContentView(scrollView); }