Commit d4ea85cc authored by Varun Patil's avatar Varun Patil

Add new notifications (news and PT)

parent 8d9e3169
...@@ -16,7 +16,9 @@ import java.util.List; ...@@ -16,7 +16,9 @@ import java.util.List;
import app.insti.ItemClickListener; import app.insti.ItemClickListener;
import app.insti.R; import app.insti.R;
import app.insti.data.Event; import app.insti.data.Event;
import app.insti.data.NewsArticle;
import app.insti.data.Notification; import app.insti.data.Notification;
import app.insti.data.PlacementBlogPost;
public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdapter.Viewholder> { public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdapter.Viewholder> {
private List<Notification> notifications; private List<Notification> notifications;
...@@ -53,6 +55,14 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap ...@@ -53,6 +55,14 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
Event event = gson.fromJson(gson.toJson(appNotification.getNotificationActor()), Event.class); Event event = gson.fromJson(gson.toJson(appNotification.getNotificationActor()), Event.class);
Picasso.get().load(event.getEventImageURL()).into(viewholder.notificationPicture); Picasso.get().load(event.getEventImageURL()).into(viewholder.notificationPicture);
viewholder.notificationTitle.setText(event.getEventName()); viewholder.notificationTitle.setText(event.getEventName());
} else if (appNotification.getNotificationActorType().contains("newsentry")) {
NewsArticle article = gson.fromJson(gson.toJson(appNotification.getNotificationActor()), NewsArticle.class);
Picasso.get().load(article.getBody().getBodyImageURL()).into(viewholder.notificationPicture);
viewholder.notificationTitle.setText(article.getTitle());
} else if (appNotification.getNotificationActorType().contains("blogentry")) {
PlacementBlogPost post = gson.fromJson(gson.toJson(appNotification.getNotificationActor()), PlacementBlogPost.class);
Picasso.get().load(R.drawable.lotus_sq).into(viewholder.notificationPicture);
viewholder.notificationTitle.setText(post.getTitle());
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment