protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.event_tabs); addEventButton = FindViewById <Button>(Resource.Id.addEventButton); eventListView = FindViewById <RecyclerView>(Resource.Id.eventEditView); draftListView = FindViewById <RecyclerView>(Resource.Id.draftView); //Navigation bar BottomNavigationView navigation = FindViewById <BottomNavigationView>(Resource.Id.navigation); navigation.LayoutParameters.Width = ViewGroup.LayoutParams.FillParent; navigation.SetOnNavigationItemSelectedListener(this); List <Event> fullEventList = RequestSender.GetBriefEvents(); var accounts = RequestSender.GetAccounts(); if (RequestSender.ThisAccount().Can((uint)Permissions.EDIT_OTHER_EVENTS)) { eventList = fullEventList; } else { eventList = fullEventList.Where(item => item.Author == RequestSender.GetLoggedInAccountId()).ToList(); } eventListView.HasFixedSize = true; eventListView.AddItemDecoration(new DividerItemDecoration(this, DividerItemDecoration.Vertical)); eventListLayout = new LinearLayoutManager(this); eventListView.SetLayoutManager(eventListLayout); eventListAdapter = new EventListAdapter(eventList); eventListView.SetAdapter(eventListAdapter); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.admin_panel); // Create your application here silenceButton = FindViewById <Button>(Resource.Id.silenceButton); silenceButton.Click += SilenceClick; deleteButton = FindViewById <Button>(Resource.Id.deleteButton); deleteButton.Click += DeleteClick; banButton = FindViewById <Button>(Resource.Id.banButton); banButton.Click += BanClick; accountList = FindViewById <RecyclerView>(Resource.Id.recyclerView); accountLabel = FindViewById <TextView>(Resource.Id.selectedAccount); list = RequestSender.GetAccounts(); accountList.HasFixedSize = true; accountListLayout = new LinearLayoutManager(this); accountList.SetLayoutManager(accountListLayout); accountListAdapter = new AccountListAdapter(list); accountList.SetAdapter(accountListAdapter); }