@Override
    public int getItemViewType(int headerPosition) {
        if (0 == headerPosition) {
            return LogicHandler.VIEWTYPE_HEADER;
        } else {
            int pos = headerPosition - 1;
            return mLogic.getItemViewType(pos, mList.get(pos));
        }
    }
A simple adapter which also inserts a header item ".." to handle going up to the parent folder.

@param <T> the type which is used, for example a normal java File object.
android/modules/module_filepicker/src/main/java/com/nononsenseapps/filepicker/FileItemAdapter.java