Commit 6fdd22fb authored by Sajal Narang's avatar Sajal Narang Committed by GitHub

Merge pull request #197 from safwankdb/master

Notification has navigate button only when venue exists
parents 6cc015bc d8296b96
...@@ -184,14 +184,17 @@ public class NotificationIntentService extends JobIntentService { ...@@ -184,14 +184,17 @@ public class NotificationIntentService extends JobIntentService {
builder.setContentIntent(pendingIntent); builder.setContentIntent(pendingIntent);
builder.setDeleteIntent(NotificationEventReceiver.getDeleteIntent(getApplicationContext())); builder.setDeleteIntent(NotificationEventReceiver.getDeleteIntent(getApplicationContext()));
Intent navigateIntent = new Intent(getApplicationContext(), NotificationIntentService.class); if(event.getEventVenues().size() > 0)
navigateIntent.setAction(ACTION_NAVIGATE); {
navigateIntent.putExtra(Constants.EVENT_ID, event.getEventID()); Intent navigateIntent = new Intent(getApplicationContext(), NotificationIntentService.class);
navigateIntent.putExtra(Constants.EVENT_LATITUDE, event.getEventVenues().get(0).getVenueLatitude()); navigateIntent.setAction(ACTION_NAVIGATE);
navigateIntent.putExtra(Constants.EVENT_LONGITUDE, event.getEventVenues().get(0).getVenueLongitude()); navigateIntent.putExtra(Constants.EVENT_ID, event.getEventID());
navigateIntent.putExtra("NOTIFICATION_ID", NOTIFICATION_ID); navigateIntent.putExtra(Constants.EVENT_LATITUDE, event.getEventVenues().get(0).getVenueLatitude());
PendingIntent navigatePendingIntent = PendingIntent.getService(getApplicationContext(), 0, navigateIntent, PendingIntent.FLAG_UPDATE_CURRENT); navigateIntent.putExtra(Constants.EVENT_LONGITUDE, event.getEventVenues().get(0).getVenueLongitude());
builder.addAction(R.drawable.baseline_navigation_white_24, "Navigate", navigatePendingIntent); navigateIntent.putExtra("NOTIFICATION_ID", NOTIFICATION_ID);
PendingIntent navigatePendingIntent = PendingIntent.getService(getApplicationContext(), 0, navigateIntent, PendingIntent.FLAG_UPDATE_CURRENT);
builder.addAction(R.drawable.baseline_navigation_white_24, "Navigate", navigatePendingIntent);
}
Intent notGoingIntent = new Intent(getApplicationContext(), NotificationIntentService.class); Intent notGoingIntent = new Intent(getApplicationContext(), NotificationIntentService.class);
notGoingIntent.setAction(ACTION_NOT_GOING); notGoingIntent.setAction(ACTION_NOT_GOING);
......
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