use of com.instructure.candroid.adapter.MasteryPathOptionsRecyclerAdapter in project instructure-android by instructure.
the class MasteryPathOptionsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
mRootView = getLayoutInflater().inflate(R.layout.fragment_mastery_paths_options, container, false);
mRecyclerAdapter = new MasteryPathOptionsRecyclerAdapter(getContext(), getCanvasContext(), mAssignments, new AdapterToFragmentCallback<Assignment>() {
@Override
public void onRowClicked(Assignment assignment, int position, boolean isOpenDetail) {
Navigation navigation = getNavigation();
if (navigation != null) {
Bundle bundle = AssignmentBasicFragment.createBundle(getCanvasContext(), assignment);
navigation.addFragment(FragUtils.getFrag(AssignmentBasicFragment.class, bundle));
}
}
@Override
public void onRefreshFinished() {
}
});
configureRecyclerView(mRootView, getContext(), mRecyclerAdapter, R.id.swipeRefreshLayout, R.id.emptyPandaView, R.id.listView);
// disable the swiperefreshlayout because we don't want to pull to refresh. It doesn't make an API call, so it wouldn't refresh anything
mRootView.findViewById(R.id.swipeRefreshLayout).setEnabled(false);
mSelect = (Button) mRootView.findViewById(R.id.select_option);
mSelect.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
ModuleManager.selectMasteryPath(getCanvasContext(), mModuleObjectId, mModuleItemId, mAssignmentSet.getId(), mSelectOptionCallback);
}
});
setupCallbacks();
return mRootView;
}
Aggregations