Search in sources :

Example 1 with PeopleListRecyclerAdapter

use of com.instructure.candroid.adapter.PeopleListRecyclerAdapter in project instructure-android by instructure.

the class PeopleListFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mAdapterToFragmentCallback = new AdapterToFragmentCallback<User>() {

        @Override
        public void onRowClicked(User user, int position, boolean isOpenDetail) {
            Navigation navigation = getNavigation();
            if (navigation != null) {
                navigation.addFragment(FragUtils.getFrag(PeopleDetailsFragment.class, PeopleDetailsFragment.createBundle(user, getCanvasContext())));
            }
        }

        @Override
        public void onRefreshFinished() {
            setRefreshing(false);
        }
    };
    mRootView = getLayoutInflater().inflate(R.layout.fragment_people_list, container, false);
    mToolbar = mRootView.findViewById(R.id.toolbar);
    CardView cardView = mRootView.findViewById(R.id.cardView);
    if (cardView != null) {
        cardView.setCardBackgroundColor(Color.WHITE);
    }
    mRecyclerAdapter = new PeopleListRecyclerAdapter(getContext(), getCanvasContext(), mAdapterToFragmentCallback);
    configureRecyclerView(mRootView, getContext(), mRecyclerAdapter, R.id.swipeRefreshLayout, R.id.emptyPandaView, R.id.listView);
    return mRootView;
}
Also used : User(com.instructure.canvasapi2.models.User) Navigation(com.instructure.interactions.Navigation) CardView(android.support.v7.widget.CardView) PeopleListRecyclerAdapter(com.instructure.candroid.adapter.PeopleListRecyclerAdapter)

Aggregations

CardView (android.support.v7.widget.CardView)1 PeopleListRecyclerAdapter (com.instructure.candroid.adapter.PeopleListRecyclerAdapter)1 User (com.instructure.canvasapi2.models.User)1 Navigation (com.instructure.interactions.Navigation)1