use of com.instructure.candroid.interfaces.AdapterToFragmentCallback in project instructure-android by instructure.
the class PageListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
mRootView = getLayoutInflater().inflate(R.layout.fragment_course_pages, container, false);
mToolbar = mRootView.findViewById(R.id.toolbar);
mRecyclerAdapter = new PageListRecyclerAdapter(getContext(), getCanvasContext(), new AdapterToFragmentCallback<Page>() {
@Override
public void onRowClicked(Page page, int position, boolean isOpenDetail) {
Navigation navigation = getNavigation();
if (navigation != null) {
Bundle bundle = PageDetailsFragment.Companion.createBundle(page.getUrl(), getCanvasContext());
navigation.addFragment(FragUtils.getFrag(PageDetailsFragment.class, bundle));
}
}
@Override
public void onRefreshFinished() {
setRefreshing(false);
}
}, mDefaultSelectedPageTitle);
configureRecyclerView(mRootView, getContext(), mRecyclerAdapter, R.id.swipeRefreshLayout, R.id.emptyPandaView, R.id.listView);
return mRootView;
}
use of com.instructure.candroid.interfaces.AdapterToFragmentCallback in project instructure-android by instructure.
the class RubricFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_list, container, false);
rootView.findViewById(R.id.fragment_container).setBackgroundColor(Color.WHITE);
EmptyPandaView emptyRubricView = (EmptyPandaView) rootView.findViewById(R.id.emptyPandaView);
mRecyclerAdapter = new RubricRecyclerAdapter(getContext(), getCanvasContext(), new AdapterToFragmentCallback() {
@Override
public void onRowClicked(Object o, int position, boolean isOpenDetail) {
}
@Override
public void onRefreshFinished() {
setRefreshing(false);
}
});
configureRecyclerView(rootView, getContext(), mRecyclerAdapter, R.id.swipeRefreshLayout, R.id.emptyPandaView, R.id.listView);
PandaRecyclerView pandaRecyclerView = (PandaRecyclerView) rootView.findViewById(R.id.listView);
pandaRecyclerView.addItemDecoration(new RubricDecorator(getContext()));
return rootView;
}
use of com.instructure.candroid.interfaces.AdapterToFragmentCallback 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