Exemplo n.º 1
0
        internal override void Reload(RecyclerViewObservableAdapterBase adapter)
        {
            ItemsMap.Clear();
            ItemsMap.Add(ItemMap.CreateForHeader());

            var sectionsCount = adapter.GetSectionsCount();

            for (var section = 0; section < sectionsCount; section++)
            {
                ItemsMap.Add(ItemMap.CreateForSectionHeader(null));

                var sectionItemsCount = adapter.GetSectionItemsCount(section);

                for (var row = 0; row < sectionItemsCount; row++)
                {
                    ItemsMap.Add(ItemMap.CreateForItem(adapter.GetItem(section, row)));
                }

                ItemsMap.Add(ItemMap.CreateForSectionFooter(null));
            }

            ItemsMap.Add(ItemMap.CreateForFooter());

            adapter.NotifyDataSetChanged();
        }