protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.CreateEmployee); _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); ToolbarCreator toolbarCreator = new ToolbarCreator(); toolbarCreator.setupToolbar(_supporttoolbar, _drawer, _navigationview, Resource.String.createemployee, this); BtnCreateEmployee = FindViewById<Button>(Resource.Id.ButtonCreateEmployee); EditTextFirstName = FindViewById<EditText>(Resource.Id.EditTextFirstName); EditTextLastName = FindViewById<EditText>(Resource.Id.EditTextLastName); EditTextEmployeeID = FindViewById<EditText>(Resource.Id.EditTextEmployeeID); EditTextEmail = FindViewById<EditText>(Resource.Id.EditTextEmail); SpinnerDepartment = FindViewById<Spinner>(Resource.Id.SpinnerDepartment); SpinnerPrivledge = FindViewById<Spinner>(Resource.Id.SpinnerPrivledgeLevel); Color color = new Color(ContextCompat.GetColor(this, Resource.Color.black)); SpinnerDepartment.Background.SetColorFilter(color,PorterDuff.Mode.SrcAtop); SpinnerPrivledge.Background.SetColorFilter(color, PorterDuff.Mode.SrcAtop); BtnCreateEmployee.Click += async delegate { BtnCreateEmployee.Enabled = false; await createEmployee(); BtnCreateEmployee.Enabled = true; }; }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); switch (IoC.UserInfo.Employee.PrivledgeLevel) { case "Admin": { SetContentView(Resource.Layout.EventDeletion_Admin); eventItemAdapter = new EventItemAdapter(this, Resource.Layout.EventDeletion_Admin); break; } case "Moderator": { SetContentView(Resource.Layout.EventDeletion_Moderator); eventItemAdapter = new EventItemAdapter(this, Resource.Layout.EventDeletion_Moderator); break; } } eventDeleter = new EventDeleter(); deletionListView = FindViewById<ListView>(Resource.Id.listDeletion); DeleteEventsBtn = FindViewById<Button>(Resource.Id.DeleteEventsBtn); await RefreshView(); FindViewById(Resource.Id.loadingPanel).Visibility = ViewStates.Gone; _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); ToolbarCreator toolbarCreator = new ToolbarCreator(); toolbarCreator.setupToolbar(_supporttoolbar, _drawer, _navigationview, Resource.String.event_deletion, this); if (IoC.UserInfo.Employee.PrivledgeLevel == "Admin") { myEventList = eventItemAdapter.getAllEventsNotDeleted(); } else { myEventList = eventItemAdapter.getEventsByEmployeeID(); } sortByDate(myEventList); //Plug in my adapter myCheckBoxAdapter = new CheckBoxAdapter(this,myEventList); deletionListView.Adapter = myCheckBoxAdapter; RegisterForContextMenu(deletionListView); DeleteEventsBtn.Click += delegate { checkedEvents = ((CheckBoxAdapter)deletionListView.Adapter).getCheckedList(); deleteEvents(deletionListView.Adapter.Count); }; }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); switch (IoC.UserInfo.Employee.PrivledgeLevel) { case "Admin": { SetContentView(Resource.Layout.Calendar_Admin); eventItemAdapter = new EventItemAdapter(); recipientListItemAdapter = new RecipientListItemAdapter(); break; } case "Moderator": { SetContentView(Resource.Layout.Calendar_Moderator); eventItemAdapter = new EventItemAdapter(); recipientListItemAdapter = new RecipientListItemAdapter(); break; } default: { SetContentView(Resource.Layout.Calendar_User); eventItemAdapter = new EventItemAdapter(); recipientListItemAdapter = new RecipientListItemAdapter(); break; } } _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); ToolbarCreator toolbarCreator = new ToolbarCreator(); toolbarCreator.setupToolbar(_supporttoolbar, _drawer, _navigationview, Resource.String.calendar_view, this); var nextYear = DateTime.Now.AddYears(1); var lastYear = DateTime.Now.AddYears(-1); calendar = FindViewById<CalendarPickerView>(Resource.Id.calendar_view); calendar.Init(lastYear, nextYear) .WithSelectedDate(DateTime.Now) .InMode(CalendarPickerView.SelectionMode.Single); await RefreshView(); myEventList = recipientListItemAdapter.getEventsByEmployeeID(IoC.UserInfo.EmployeeID, eventItemAdapter); myEventList = filterEvents(); setHighlightDates(calendar); calendar.DateSelected += delegate { IoC.selectedDate = calendar.SelectedDate; Intent intent = new Intent(this, typeof(CalendarListActivity)); StartActivity(intent); }; }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); //setup toolbar switch (IoC.UserInfo.Employee.PrivledgeLevel) { case "Admin": { SetContentView(Resource.Layout.EventDetails_Admin); break; } case "Moderator": { SetContentView(Resource.Layout.EventDetails_Moderator); break; } default: { SetContentView(Resource.Layout.EventDetails_User); break; } } _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); ToolbarCreator toolbarCreator = new ToolbarCreator(); toolbarCreator.setupToolbar(_supporttoolbar, _drawer, _navigationview, Resource.String.event_details, this); Name = FindViewById<TextView>(Resource.Id.NameText); Date = FindViewById<TextView>(Resource.Id.DateText); Time = FindViewById<TextView>(Resource.Id.TimeText); Location = FindViewById<TextView>(Resource.Id.LocationText); Category = FindViewById<TextView>(Resource.Id.Category); Description = FindViewById<TextView>(Resource.Id.DescriptionText); Name.Text = Intent.GetStringExtra("Name") ?? "Data not available"; Date.Text = Intent.GetStringExtra("Date") ?? "Data not available"; Time.Text = Intent.GetStringExtra("Time") ?? "Data not available"; Location.Text = Intent.GetStringExtra("Location") ?? "Data not available"; Category.Text = Intent.GetStringExtra("Category") ?? "Data not available"; Description.Text = Intent.GetStringExtra("Description") ?? "Data not available"; }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); switch (IoC.UserInfo.Employee.PrivledgeLevel) { case "Admin": { SetContentView(Resource.Layout.CalendarList_Admin); eventItemAdapter = new EventItemAdapter(this, Resource.Layout.CalendarList_Admin); break; } case "Moderator": { SetContentView(Resource.Layout.CalendarList_Moderator); eventItemAdapter = new EventItemAdapter(this, Resource.Layout.CalendarList_Moderator); break; } default: { SetContentView(Resource.Layout.CalendarList_User); eventItemAdapter = new EventItemAdapter(this, Resource.Layout.CalendarList_User); break; } } await RefreshView(); FindViewById(Resource.Id.loadingPanel).Visibility = ViewStates.Gone; _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); ToolbarCreator toolbarCreator = new ToolbarCreator(); toolbarCreator.setupToolbar(_supporttoolbar, _drawer, _navigationview, Resource.String.event_list, this); myEventList = eventItemAdapter.getEventsByEmployeeID(); DateTime date = IoC.selectedDate; myEventList = filterByDate(date); calendarListView = FindViewById<ListView>(Resource.Id.listCalendar); myCalendarAdapter = new CalendarAdapter(this, myEventList); calendarListView.Adapter = myCalendarAdapter; RegisterForContextMenu(calendarListView); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); switch (IoC.UserInfo.Employee.PrivledgeLevel) { case "Admin": { SetContentView(Resource.Layout.Overtime_Admin); break; } case "Moderator": { SetContentView(Resource.Layout.Overtime_Moderator); break; } default: { SetContentView(Resource.Layout.Overtime_User); break; } } _supporttoolbar = FindViewById<Android.Support.V7.Widget.Toolbar>(Resource.Id.ToolBar); _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); ToolbarCreator toolbarCreator = new ToolbarCreator(); toolbarCreator.setupToolbar(_supporttoolbar, _drawer, _navigationview, Resource.String.overtime_schedule, this); Button overtimeBtn = FindViewById<Button>(Resource.Id.ButtonOvertime); overtimeBtn.Click += delegate { Intent browse = new Intent(Intent.ActionView, Android.Net.Uri.Parse("https://drive.google.com/open?id=0B2kq5WLtKIJHRUtsT0x3cWlPQ1k")); StartActivity(browse); }; }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); await IoC.UserInfo.setEmployee(); // Set our view from the "main" layout resource await IoC.UserInfo.setEmployee(); switch (IoC.UserInfo.Employee.PrivledgeLevel) { case "Admin": { SetContentView(Resource.Layout.RecentEvents_Admin); eventItemAdapter = new EventItemAdapter(this, Resource.Layout.RecentEvents_Admin); recipientListItemAdapter = new RecipientListItemAdapter(this, Resource.Layout.RecentEvents_Admin); break; } case "Moderator": { SetContentView(Resource.Layout.RecentEvents_Moderator); eventItemAdapter = new EventItemAdapter(this, Resource.Layout.RecentEvents_Moderator); recipientListItemAdapter = new RecipientListItemAdapter(this, Resource.Layout.RecentEvents_Moderator); break; } default: { SetContentView(Resource.Layout.RecentEvents_User); eventItemAdapter = new EventItemAdapter(this, Resource.Layout.RecentEvents_User); recipientListItemAdapter = new RecipientListItemAdapter(this, Resource.Layout.RecentEvents_User); break; } } mRecyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerView); _supporttoolbar = FindViewById<Toolbar>(Resource.Id.ToolBar); _drawer = FindViewById<DrawerLayout>(Resource.Id.DrawerLayout); _navigationview = FindViewById<NavigationView>(Resource.Id.nav_view); ToolbarCreator toolbarCreator = new ToolbarCreator(); toolbarCreator.setupToolbar(_supporttoolbar, _drawer, _navigationview, Resource.String.recent_events, this); error = new ErrorHandler(this); if (IsPlayServicesAvailable()) { var intentRegistration = new Intent(this, typeof(RegistrationIntentService)); StartService(intentRegistration); } await RefreshView(); FindViewById(Resource.Id.loadingPanel).Visibility = ViewStates.Gone; myEventList = recipientListItemAdapter.getEventsByEmployeeID(IoC.UserInfo.EmployeeID, eventItemAdapter); myEventList = filterEvents(); sortByDate(myEventList); //Plug in the linear layout manager mLayoutManager = new LinearLayoutManager(this); mRecyclerView.SetLayoutManager(mLayoutManager); //Plug in my adapter myEventListAdapter = new EventListAdapter(myEventList); myEventListAdapter.ItemClick += OnItemClick; mRecyclerView.SetAdapter(myEventListAdapter); }