use of com.mikepenz.aboutlibraries.ui.item.LoaderItem in project AboutLibraries by mikepenz.
the class LibsFragmentCompat method onCreateView.
public View onCreateView(Context context, LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, Bundle arguments) {
if (arguments != null) {
builder = (LibsBuilder) arguments.getSerializable("data");
} else {
Log.e("AboutLibraries", "The AboutLibraries fragment can't be build without the bundle containing the LibsBuilder");
}
View view = inflater.inflate(R.layout.fragment_opensource, container, false);
// allows to modify the view before creating
if (LibsConfiguration.getInstance().getUiListener() != null) {
view = LibsConfiguration.getInstance().getUiListener().preOnCreateView(view);
}
// init CardView
RecyclerView mRecyclerView;
if (view.getId() == R.id.cardListView) {
mRecyclerView = (RecyclerView) view;
} else {
mRecyclerView = (RecyclerView) view.findViewById(R.id.cardListView);
}
mRecyclerView.setLayoutManager(new LinearLayoutManager(context));
if (LibsConfiguration.getInstance().getItemAnimator() != null) {
mRecyclerView.setItemAnimator(LibsConfiguration.getInstance().getItemAnimator());
} else {
mRecyclerView.setItemAnimator(new DefaultItemAnimator());
}
if (builder != null) {
mItemAdapter = new ItemAdapter();
mAdapter = FastAdapter.with(mItemAdapter);
mRecyclerView.setAdapter(mAdapter);
if (builder.showLoadingProgress) {
mItemAdapter.add(new LoaderItem());
}
}
// allows to modify the view after creating
if (LibsConfiguration.getInstance().getUiListener() != null) {
view = LibsConfiguration.getInstance().getUiListener().postOnCreateView(view);
}
return view;
}
Aggregations