Search in sources :

Example 1 with AppsRecyclerAdapter

use of com.amaze.filemanager.adapters.AppsRecyclerAdapter in project AmazeFileManager by TeamAmaze.

the class AppsListFragment method onLoadFinished.

@Override
public void onLoadFinished(@NonNull Loader<List<AppDataParcelable>> loader, List<AppDataParcelable> data) {
    getSpinner().setVisibility(View.GONE);
    if (data.isEmpty()) {
        getRecyclerView().setVisibility(View.GONE);
        rootView.findViewById(R.id.empty_text_view).setVisibility(View.VISIBLE);
    } else {
        appDataParcelableList = new ArrayList<>(data);
        List<AppDataParcelable> adapterList = new ArrayList<>();
        for (AppDataParcelable appDataParcelable : data) {
            if (!showSystemApps && appDataParcelable.isSystemApp()) {
                continue;
            }
            adapterList.add(appDataParcelable);
        }
        adapter = new AppsRecyclerAdapter(this, modelProvider, false, this, adapterList);
        getRecyclerView().setVisibility(View.VISIBLE);
        getRecyclerView().setAdapter(adapter);
    }
}
Also used : AppDataParcelable(com.amaze.filemanager.adapters.data.AppDataParcelable) ArrayList(java.util.ArrayList) AppsRecyclerAdapter(com.amaze.filemanager.adapters.AppsRecyclerAdapter)

Aggregations

AppsRecyclerAdapter (com.amaze.filemanager.adapters.AppsRecyclerAdapter)1 AppDataParcelable (com.amaze.filemanager.adapters.data.AppDataParcelable)1 ArrayList (java.util.ArrayList)1