public void setAdapter(ListAdapter adapter) {
        if (mAdapter != null) {
            mAdapter.unregisterDataSetObserver(dataSetObserver);
        }

        // remove all the current views
        removeAllViews();

        mAdapter = adapter;
        mPageCount = adapter == null ? 0 : mAdapter.getCount();

        if (adapter != null) {
            mAdapter.registerDataSetObserver(dataSetObserver);

            mRecycler.setViewTypeCount(mAdapter.getViewTypeCount());
            mRecycler.invalidateScraps();
        }

        // TODO pretty confusing
        // this will be correctly set in setFlipDistance method
        mCurrentPageIndex = INVALID_PAGE_POSITION;
        mFlipDistance = INVALID_FLIP_DISTANCE;
        setFlipDistance(0);

        updateEmptyStatus();
    }
@param adapter a regular ListAdapter, not all methods if the list adapter are
               used by the flipview
app/src/main/java/home/smart/fly/animations/customview/flipview/FlipView.java