use of com.instructure.candroid.adapter.NotificationListRecyclerAdapter in project instructure-android by instructure.
the class NotificationListFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
mRootView = getLayoutInflater().inflate(R.layout.fragment_list_notification, container, false);
mToolbar = mRootView.findViewById(R.id.toolbar);
mAdapterToFragmentCallback = new NotificationAdapterToFragmentCallback<StreamItem>() {
@Override
public void onRowClicked(StreamItem streamItem, int position, boolean isOpenDetail) {
mRecyclerAdapter.setSelectedPosition(position);
Navigation navigation = getNavigation();
if (navigation != null) {
onRowClick(streamItem, isOpenDetail);
}
}
@Override
public void onRefreshFinished() {
setRefreshing(false);
mEditOptions.setVisibility(View.GONE);
}
@Override
public void onShowEditView(boolean isVisible) {
mEditOptions.setVisibility(isVisible ? View.VISIBLE : View.GONE);
}
@Override
public void onShowErrorCrouton(int message) {
showToast(message);
}
};
mRecyclerAdapter = new NotificationListRecyclerAdapter(getContext(), getCanvasContext(), onNotificationCountInvalidated, mAdapterToFragmentCallback);
configureRecyclerView(mRootView, getContext(), mRecyclerAdapter, R.id.swipeRefreshLayout, R.id.emptyPandaView, R.id.listView);
PandaRecyclerView pandaRecyclerView = mRootView.findViewById(R.id.listView);
pandaRecyclerView.setSelectionEnabled(false);
configureViews(mRootView);
return mRootView;
}
Aggregations