@Override
    public void onAttachedToWindow(RecyclerView view) {
        super.onAttachedToWindow(view);

        try {
            adapter = (SectioningAdapter) view.getAdapter();
        } catch (ClassCastException e) {
            throw new ClassCastException("StickyHeaderLayoutManager must be used with a RecyclerView where the adapter is a kind of SectioningAdapter");
        }
    }
Assign callback object to be notified when a header view position changes between states of the HeaderPosition enum

@param headerPositionChangedCallback the callback
@see HeaderPosition
android/modules/module_common/src/main/java/github/tornaco/android/thanos/widget/section/StickyHeaderLayoutManager.java