Commit 4a69f872 authored by Varun Patil's avatar Varun Patil

Use resized images in notification adapter

parent a24109f3
...@@ -13,6 +13,7 @@ import com.squareup.picasso.Picasso; ...@@ -13,6 +13,7 @@ import com.squareup.picasso.Picasso;
import java.util.List; import java.util.List;
import app.insti.Constants;
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;
...@@ -53,11 +54,15 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap ...@@ -53,11 +54,15 @@ public class NotificationsAdapter extends RecyclerView.Adapter<NotificationsAdap
viewholder.notificationVerb.setText(appNotification.getNotificationVerb()); viewholder.notificationVerb.setText(appNotification.getNotificationVerb());
if (appNotification.getNotificationActorType().contains("event")) { if (appNotification.getNotificationActorType().contains("event")) {
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(
Constants.resizeImageUrl(event.getEventImageURL(), 200)
).into(viewholder.notificationPicture);
viewholder.notificationTitle.setText(event.getEventName()); viewholder.notificationTitle.setText(event.getEventName());
} else if (appNotification.getNotificationActorType().contains("newsentry")) { } else if (appNotification.getNotificationActorType().contains("newsentry")) {
NewsArticle article = gson.fromJson(gson.toJson(appNotification.getNotificationActor()), NewsArticle.class); NewsArticle article = gson.fromJson(gson.toJson(appNotification.getNotificationActor()), NewsArticle.class);
Picasso.get().load(article.getBody().getBodyImageURL()).into(viewholder.notificationPicture); Picasso.get().load(
Constants.resizeImageUrl(article.getBody().getBodyImageURL(), 200)
).into(viewholder.notificationPicture);
viewholder.notificationTitle.setText(article.getTitle()); viewholder.notificationTitle.setText(article.getTitle());
} else if (appNotification.getNotificationActorType().contains("blogentry")) { } else if (appNotification.getNotificationActorType().contains("blogentry")) {
PlacementBlogPost post = gson.fromJson(gson.toJson(appNotification.getNotificationActor()), PlacementBlogPost.class); PlacementBlogPost post = gson.fromJson(gson.toJson(appNotification.getNotificationActor()), PlacementBlogPost.class);
......
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