Search in sources :

Example 1 with GistFilesAdapter

use of com.fastaccess.ui.adapter.GistFilesAdapter in project FastHub by k0shk0sh.

the class GistFilesListFragment method onFragmentCreated.

@Override
protected void onFragmentCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    stateLayout.setEmptyText(R.string.no_files);
    stateLayout.showEmptyState();
    recycler.setEmptyView(stateLayout, refresh);
    refresh.setEnabled(false);
    adapter = new GistFilesAdapter(getPresenter().getFiles(), getPresenter(), isOwner);
    recycler.setAdapter(adapter);
    if (getArguments() != null && savedInstanceState == null) {
        ArrayList<FilesListModel> filesListModel = getArguments().getParcelableArrayList(BundleConstant.ITEM);
        isOwner = getArguments().getBoolean(BundleConstant.EXTRA_TYPE);
        onInitFiles(filesListModel, isOwner);
        // CLEAR
        setArguments(null);
    } else {
        onInitFiles(getPresenter().getFiles(), isOwner);
    }
    fastScroller.attachRecyclerView(recycler);
}
Also used : GistFilesAdapter(com.fastaccess.ui.adapter.GistFilesAdapter) FilesListModel(com.fastaccess.data.dao.FilesListModel)

Aggregations

FilesListModel (com.fastaccess.data.dao.FilesListModel)1 GistFilesAdapter (com.fastaccess.ui.adapter.GistFilesAdapter)1