use of com.kickstarter.models.pushdata.Activity in project android-oss by kickstarter.
the class PushNotifications method displayNotificationFromFriendFollowActivity.
private void displayNotificationFromFriendFollowActivity(@NonNull final PushNotificationEnvelope envelope) {
final GCM gcm = envelope.gcm();
final Activity activity = envelope.activity();
if (activity == null) {
return;
}
final Notification notification = notificationBuilder(gcm.title(), gcm.alert()).setLargeIcon(fetchBitmap(activity.userPhoto(), true)).build();
notificationManager().notify(envelope.signature(), notification);
}
use of com.kickstarter.models.pushdata.Activity in project android-oss by kickstarter.
the class PushNotifications method fetchUpdateWithEnvelope.
@Nullable
private Observable<Pair<PushNotificationEnvelope, Update>> fetchUpdateWithEnvelope(@NonNull final PushNotificationEnvelope envelope) {
final Activity activity = envelope.activity();
if (activity == null) {
return null;
}
final Long updateId = activity.updateId();
if (updateId == null) {
return null;
}
final Long projectId = activity.projectId();
if (projectId == null) {
return null;
}
final String projectParam = ObjectUtils.toString(projectId);
final String updateParam = ObjectUtils.toString(updateId);
final Observable<Update> update = client.fetchUpdate(projectParam, updateParam).compose(Transformers.neverError());
return Observable.just(envelope).compose(Transformers.combineLatestPair(update));
}
use of com.kickstarter.models.pushdata.Activity in project android-oss by kickstarter.
the class DebugPushNotificationsView method simulateProjectCancellationButtonClick.
@OnClick(R.id.simulate_project_cancellation_button)
public void simulateProjectCancellationButtonClick() {
final GCM gcm = GCM.builder().title("Kickstarter").alert("SKULL GRAPHIC TEE has been canceled.").build();
final Activity activity = Activity.builder().category(com.kickstarter.models.Activity.CATEGORY_CANCELLATION).id(3).projectId(PROJECT_ID).projectPhoto(PROJECT_PHOTO).build();
final PushNotificationEnvelope envelope = PushNotificationEnvelope.builder().activity(activity).gcm(gcm).build();
pushNotifications.add(envelope);
}
use of com.kickstarter.models.pushdata.Activity in project android-oss by kickstarter.
the class DebugPushNotificationsView method simulateProjectFailureButtonClick.
@OnClick(R.id.simulate_project_failure_button)
public void simulateProjectFailureButtonClick() {
final GCM gcm = GCM.builder().title("Kickstarter").alert("SKULL GRAPHIC TEE was not successfully funded.").build();
final Activity activity = Activity.builder().category(com.kickstarter.models.Activity.CATEGORY_FAILURE).id(4).projectId(PROJECT_ID).projectPhoto(PROJECT_PHOTO).build();
final PushNotificationEnvelope envelope = PushNotificationEnvelope.builder().activity(activity).gcm(gcm).build();
pushNotifications.add(envelope);
}
use of com.kickstarter.models.pushdata.Activity in project android-oss by kickstarter.
the class DebugPushNotificationsView method simulateFriendBackingButtonClick.
@OnClick(R.id.simulate_friend_backing_button)
public void simulateFriendBackingButtonClick() {
final GCM gcm = GCM.builder().title("Check it out").alert("Christopher Wright backed SKULL GRAPHIC TEE.").build();
final Activity activity = Activity.builder().category(com.kickstarter.models.Activity.CATEGORY_BACKING).id(1).projectId(PROJECT_ID).projectPhoto(PROJECT_PHOTO).build();
final PushNotificationEnvelope envelope = PushNotificationEnvelope.builder().activity(activity).gcm(gcm).build();
pushNotifications.add(envelope);
}
Aggregations