use of com.alexstyl.specialdates.upcoming.view.OnUpcomingEventClickedListener in project Memento-Calendar by alexstyl.
the class UpcomingEventsFragment method onCreateView.
@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment_upcoming_events, container, false);
root = Views.findById(view, R.id.root);
progressBar = Views.findById(view, R.id.upcoming_events_progress);
emptyView = Views.findById(view, R.id.upcoming_events_emptyview);
upcomingList = Views.findById(view, R.id.upcoming_events_list);
upcomingList.setHasFixedSize(true);
upcomingList.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false));
upcomingList.addItemDecoration(new UpcomingEventsDecorator(getResources().getDimensionPixelSize(R.dimen.upcoming_event_header_vertical_spacing), getResources().getDimensionPixelSize(R.dimen.upcoming_event_vertical_spacing)));
adapter = new UpcomingEventsAdapter(new UpcomingViewHolderFactory(inflater, imageLoader), new OnUpcomingEventClickedListener() {
@Override
public void onContactClicked(Contact contact) {
navigator.toContactDetails(contact, getActivity());
}
@Override
public void onNamedayClicked(Date date) {
navigator.toDateDetails(date, getActivity());
}
});
adapter.setHasStableIds(true);
upcomingList.setAdapter(adapter);
return view;
}
Aggregations