Search in sources :

Example 1 with ListItemsAdapter

use of com.battlelancer.seriesguide.adapters.ListItemsAdapter in project SeriesGuide by UweTrottmann.

the class ListsFragment method onActivityCreated.

@Override
public void onActivityCreated(Bundle savedInstanceState) {
    super.onActivityCreated(savedInstanceState);
    mAdapter = new ListItemsAdapter(getActivity(), onContextMenuClickListener);
    if (getView() == null) {
        return;
    }
    // setup grid view
    GridView gridView = (GridView) getView().findViewById(android.R.id.list);
    // enable app bar scrolling out of view only on L or higher
    ViewCompat.setNestedScrollingEnabled(gridView, AndroidUtils.isLollipopOrHigher());
    gridView.setAdapter(mAdapter);
    gridView.setOnItemClickListener(this);
    gridView.setEmptyView(getView().findViewById(android.R.id.empty));
    gridView.setFastScrollAlwaysVisible(false);
    gridView.setFastScrollEnabled(true);
    getLoaderManager().initLoader(LOADER_ID, getArguments(), loaderCallbacks);
}
Also used : ListItemsAdapter(com.battlelancer.seriesguide.adapters.ListItemsAdapter) GridView(android.widget.GridView)

Aggregations

GridView (android.widget.GridView)1 ListItemsAdapter (com.battlelancer.seriesguide.adapters.ListItemsAdapter)1