Search in sources :

Example 1 with NotificationsAdapter

use of in.ac.iitb.gymkhana.iitbapp.adapter.NotificationsAdapter in project IITB-App by wncc.

the class NotificationsFragment method showNotifications.

private void showNotifications(NotificationsResponse notificationsResponse) {
    List<AppNotification> notifications = notificationsResponse.getNotifications();
    NotificationsAdapter notificationsAdapter = new NotificationsAdapter(notifications, new ItemClickListener() {

        @Override
        public void onItemClick(View v, int position) {
        // TODO: What to do?
        }
    });
    notificationsRecyclerView = (RecyclerView) getActivity().findViewById(R.id.notifications_recycler_view);
    notificationsRecyclerView.setAdapter(notificationsAdapter);
    notificationsRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
}
Also used : NotificationsAdapter(in.ac.iitb.gymkhana.iitbapp.adapter.NotificationsAdapter) ItemClickListener(in.ac.iitb.gymkhana.iitbapp.ItemClickListener) AppNotification(in.ac.iitb.gymkhana.iitbapp.api.model.AppNotification) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Aggregations

LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 View (android.view.View)1 ItemClickListener (in.ac.iitb.gymkhana.iitbapp.ItemClickListener)1 NotificationsAdapter (in.ac.iitb.gymkhana.iitbapp.adapter.NotificationsAdapter)1 AppNotification (in.ac.iitb.gymkhana.iitbapp.api.model.AppNotification)1