protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Main); _sectionAdapter = new SectionedRecyclerViewAdapter(); for (char alphabet = 'A'; alphabet <= 'Z'; alphabet++) { List <string> contacts = GetContactsWithLetter(alphabet); if (contacts.Count > 0) { _sectionAdapter.AddSection(new ContactsSection(alphabet.ToString(), contacts)); } } RecyclerView recyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerview); recyclerView.SetLayoutManager(new LinearLayoutManager(this)); recyclerView.SetAdapter(_sectionAdapter); }
public GridSpanner(SectionedRecyclerViewAdapter adapt, int totalCols) { adapter = adapt; this.totalCols = totalCols; }