protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); _persoon = Gegevens.GetPerson(); _groep = Gegevens.CurrentGroup(); SetContentView(Resource.Layout.Betaalscherm); _toolbar = FindViewById<Toolbar>(Resource.Id.toolbar); ImageView Avatar = _toolbar.FindViewById<ImageView>(Resource.Id.Avatar); TextView Title = _toolbar.FindViewById<TextView>(Resource.Id.Title); Title.Text = _groep.groepsnaam; foreach (var lid in _persoon.KrijgSchuldGroep(_groep)) { deelnemers.Add(new ListItem(lid.Key, Resource.Drawable.iconn, lid.Value, _groep)); } _adapter = new ListItemAdapter(ListItem.Session, deelnemers); _adapter.ItemClick += OnItemClick; _adapter.ItemLongClick += (sender, e) => {}; _recyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerview); _recyclerView.SetMinimumHeight(ConvertDptoPx(listItemHeight*deelnemers.Count)); _recyclerView.SetLayoutManager(new LinearLayoutManager(this)); _recyclerView.SetScrollContainer(true); _recyclerView.NestedScrollingEnabled = false; _recyclerView.SetAdapter(_adapter); SetSupportActionBar(_toolbar); SupportActionBar.Title = ""; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.Groepscherm); _persoon = Gegevens.GetPerson(); _groep = Gegevens.CurrentGroup(); _toolbar = FindViewById<Toolbar>(Resource.Id.toolbar); TextView title = _toolbar.FindViewById<TextView>(Resource.Id.Title); title.Text = _groep.groepsnaam; SetSupportActionBar(_toolbar); SupportActionBar.Title = ""; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); _participantsRecyclerView = FindViewById<RecyclerView>(Resource.Id.participantsrecyclerview); _participantsRecyclerView.SetLayoutManager(new LinearLayoutManager(this)); _participantsRecyclerView.SetScrollContainer(false); _participantsRecyclerView.NestedScrollingEnabled = false; _swipeRefreshLayout = FindViewById<SwipeRefreshLayout>(Resource.Id.swipe_refresh); _swipeRefreshLayout.SetColorSchemeResources(Resource.Color.mainColor); _swipeRefreshLayout.SetOnRefreshListener(this); CardView historyCardView = FindViewById<CardView>(Resource.Id.history_card_view); Button cameraButton = FindViewById<Button>(Resource.Id.buttonCamera); Button textButton = FindViewById<Button>(Resource.Id.buttonText); Button leaveButton = FindViewById<Button>(Resource.Id.buttonLeave); leaveButton.Click += (sender, e) => { DatabaseInterface.RemoveFromGroup(_persoon.Id, _groep.groepsnaam, _persoon.Id, _persoon.Password); Finish(); }; historyCardView.Click += (sender, e) => { var activity = new Intent(this, typeof(Historyscherm)); StartActivity(activity); }; cameraButton.Click += (sender, e) => { var activity = new Intent(this, typeof(CameraActivity)); StartActivityForResult(activity, 1); }; textButton.Click += (sender, e) => { var activity = new Intent(this, typeof(Nieuwschuld)); StartActivity(activity); }; CreateParticipantsEnvironment(); }
private void CreateRecyclerView(RecyclerView rv) { rv.SetLayoutManager(new LinearLayoutManager(this.Activity)); rv.SetScrollContainer(false); rv.NestedScrollingEnabled = false; }
private void CreateParticipantsEnvironment() { _participants = new List<ListItem>(); _participantsAdapter = new ListItemAdapter(ListItem.SampleContact, _participants); _participantsAdapter.ItemClick += (sender, args) => { Toast.MakeText(this, "Removed " + ((ListItemAdapter) sender).Items[args.Position].Name, ToastLength.Short).Show(); ((ListItemAdapter) sender).Items.RemoveAt(args.Position); ((ListItemAdapter) sender).NotifyDataSetChanged(); _participantsRecyclerView.LayoutParameters.Height = ConvertDptoPx(listItemHeight * _participantsAdapter.Items.Count); }; _participantsRecyclerView = FindViewById<RecyclerView>(Resource.Id.participantsrecyclerview); _participantsRecyclerView.LayoutParameters.Height = ConvertDptoPx(listItemHeight * _participantsAdapter.Items.Count); _participantsRecyclerView.SetLayoutManager(new LinearLayoutManager(this)); _participantsRecyclerView.SetScrollContainer(false); _participantsRecyclerView.NestedScrollingEnabled = false; _participantsRecyclerView.SetAdapter(_participantsAdapter); }
private void MakeView(List<ListItem> _list, int state) { _adapter = new ListItemAdapter(state, _list); _recyclerView = FindViewById<RecyclerView>(Resource.Id.recyclerview); _recyclerView.SetMinimumHeight(ConvertDptoPx(listItemHeight*_list.Count)); _recyclerView.SetLayoutManager(new LinearLayoutManager(this)); _recyclerView.SetScrollContainer(true); _recyclerView.NestedScrollingEnabled = false; _recyclerView.SetAdapter(_adapter); SetSupportActionBar(_toolbar); SupportActionBar.Title = ""; SupportActionBar.SetDisplayHomeAsUpEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); }