private void buildSectionIndex() {
        sections = new ArrayList<>();

        int i = 0;
        for (int s = 0, ns = getNumberOfSections(); s < ns; s++) {
            Section section = new Section();
            section.adapterPosition = i;
            section.hasHeader = doesSectionHaveHeader(s);
            section.hasFooter = doesSectionHaveFooter(s);

            if (isSectionCollapsed(s)) {
                section.length = 0;
                section.numberOfItems = getNumberOfItemsInSection(s);
            } else {
                section.length = section.numberOfItems = getNumberOfItemsInSection(s);
            }

            if (section.hasHeader) {
                section.length += 2; // room for header and ghostHeader
            }
            if (section.hasFooter) {
                section.length++;
            }

            this.sections.add(section);

            i += section.length;
        }

        totalNumberOfItems = i;

        i = 0;
        sectionIndicesByAdapterPosition = new int[totalNumberOfItems];
        for (int s = 0, ns = getNumberOfSections(); s < ns; s++) {
            Section section = sections.get(s);
            for (int p = 0; p < section.length; p++) {
                sectionIndicesByAdapterPosition[i + p] = s;
            }

            i += section.length;
        }
    }
Post an action to be run later.
RecyclerView doesn't like being mutated during a scroll. We can't detect when a
scroll is actually happening, unfortunately, so the best we can do is post actions
from notify* methods to be run at a later date.

@param action action to run
android/modules/module_common/src/main/java/github/tornaco/android/thanos/widget/section/SectioningAdapter.java