test_class.declarator: mHalo
test_class.original_string: Halo mHalo;
test_class.type: Halo
test_class.var_name: mHalo
test_class.file: sdk-libs/halo-notifications/src/test/java/com/mobgen/halo/android/notifications/decorator/NotificationImageDecoratorTest.java
test_class.identifier: NotificationImageDecoratorTest
test_class.superclass: extends BaseNotificationDecoratorTest<NotificationImageDecorator>
test_case.body: @Test
      public void thatCanHandleAImageOnTheNotificationWithBottomType() throws IOException {
          final boolean[] marker = new boolean[1];
          final String text = "This is my Text And Body";
          final String image = givenAImageNotification(mHalo.context(), "bottom");
          Bundle bundle = BundleTestUtils.builder().putString("body", text).putString("title", text).build();
          when(bundle.get("image")).thenReturn(image);
          when(bundle.get("image").toString()).thenReturn(image);
          when(getBuilder().setCustomContentView(any(RemoteViews.class))).then(new Answer<Object>() {
              @Override
              public Object answer(InvocationOnMock invocation) throws Throwable {
                  marker[0] = true;
                  return null;
              }
          });
          getDecorator().decorate(getBuilder(), bundle);
          Assert.assertTrue(marker[0]);
      }
test_case.class_method_signature: NotificationImageDecoratorTest.thatCanHandleAImageOnTheNotificationWithBottomType()
test_case.full_signature: @Test public void thatCanHandleAImageOnTheNotificationWithBottomType()
test_case.identifier: thatCanHandleAImageOnTheNotificationWithBottomType
test_case.invocations: givenAImageNotification context build putString putString builder thenReturn when get thenReturn when toString get then when setCustomContentView getBuilder any decorate getDecorator getBuilder assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void thatCanHandleAImageOnTheNotificationWithBottomType()
focal_class.declarator: IMAGE_MAX_SIZE = 1000000
focal_class.modifier: private static final
focal_class.original_string: private static final int IMAGE_MAX_SIZE = 1000000;
focal_class.type: int
focal_class.var_name: IMAGE_MAX_SIZE
focal_class.declarator: IMAGE_KEY = "image"
focal_class.modifier: private static final
focal_class.original_string: private static final String IMAGE_KEY = "image";
focal_class.type: String
focal_class.var_name: IMAGE_KEY
focal_class.declarator: mContext
focal_class.modifier: private
focal_class.original_string: private Context mContext;
focal_class.type: Context
focal_class.var_name: mContext
focal_class.declarator: mActionIntent
focal_class.modifier: private
focal_class.original_string: private Intent mActionIntent;
focal_class.type: Intent
focal_class.var_name: mActionIntent
focal_class.declarator: glide
focal_class.modifier: private
focal_class.original_string: private Class<?> glide;
focal_class.type: Class<?>
focal_class.var_name: glide
focal_class.declarator: picasso
focal_class.modifier: private
focal_class.original_string: private Class<?> picasso;
focal_class.type: Class<?>
focal_class.var_name: picasso
focal_class.file: sdk-libs/halo-notifications/src/main/java/com/mobgen/halo/android/notifications/decorator/NotificationImageDecorator.java
focal_class.identifier: NotificationImageDecorator
focal_class.class_method_signature: NotificationImageDecorator.NotificationImageDecorator(Context context, HaloNotificationDecorator decorator)
focal_class.full_signature: public  NotificationImageDecorator(Context context, HaloNotificationDecorator decorator)
focal_class.identifier: NotificationImageDecorator
focal_class.modifiers: public
focal_class.parameters: (Context context, HaloNotificationDecorator decorator)
focal_class.signature:  NotificationImageDecorator(Context context, HaloNotificationDecorator decorator)
focal_class.class_method_signature: NotificationImageDecorator.decorate(@NonNull NotificationCompat.Builder builder, @NonNull Bundle bundle)
focal_class.full_signature: @Override public NotificationCompat.Builder decorate(@NonNull NotificationCompat.Builder builder, @NonNull Bundle bundle)
focal_class.identifier: decorate
focal_class.modifiers: @Override public
focal_class.parameters: (@NonNull NotificationCompat.Builder builder, @NonNull Bundle bundle)
focal_class.return: NotificationCompat.Builder
focal_class.signature: NotificationCompat.Builder decorate(@NonNull NotificationCompat.Builder builder, @NonNull Bundle bundle)
focal_class.class_method_signature: NotificationImageDecorator.getScale(int originalWidth, int originalHeight)
focal_class.full_signature: private int getScale(int originalWidth, int originalHeight)
focal_class.identifier: getScale
focal_class.modifiers: private
focal_class.parameters: (int originalWidth, int originalHeight)
focal_class.return: int
focal_class.signature: int getScale(int originalWidth, int originalHeight)
focal_class.class_method_signature: NotificationImageDecorator.getImageBitmap(@NonNull String pushImageUrl)
focal_class.full_signature: @Nullable private Bitmap getImageBitmap(@NonNull String pushImageUrl)
focal_class.identifier: getImageBitmap
focal_class.modifiers: @Nullable private
focal_class.parameters: (@NonNull String pushImageUrl)
focal_class.return: Bitmap
focal_class.signature: Bitmap getImageBitmap(@NonNull String pushImageUrl)
focal_class.class_method_signature: NotificationImageDecorator.downloadScaledBitmapFromURL(String url)
focal_class.full_signature: @Nullable private Bitmap downloadScaledBitmapFromURL(String url)
focal_class.identifier: downloadScaledBitmapFromURL
focal_class.modifiers: @Nullable private
focal_class.parameters: (String url)
focal_class.return: Bitmap
focal_class.signature: Bitmap downloadScaledBitmapFromURL(String url)
focal_class.class_method_signature: NotificationImageDecorator.getRemoteView(@PushImage.Layout String type, @NonNull Bitmap image,
                                        @Nullable String title, @Nullable String message)
focal_class.full_signature: @NonNull private RemoteViews getRemoteView(@PushImage.Layout String type, @NonNull Bitmap image,
                                        @Nullable String title, @Nullable String message)
focal_class.identifier: getRemoteView
focal_class.modifiers: @NonNull private
focal_class.parameters: (@PushImage.Layout String type, @NonNull Bitmap image,
                                        @Nullable String title, @Nullable String message)
focal_class.return: RemoteViews
focal_class.signature: RemoteViews getRemoteView(@PushImage.Layout String type, @NonNull Bitmap image,
                                        @Nullable String title, @Nullable String message)
focal_class.class_method_signature: NotificationImageDecorator.setIntent(Intent intent)
focal_class.full_signature: @VisibleForTesting public void setIntent(Intent intent)
focal_class.identifier: setIntent
focal_class.modifiers: @VisibleForTesting public
focal_class.parameters: (Intent intent)
focal_class.return: void
focal_class.signature: void setIntent(Intent intent)
focal_class.superclass: extends HaloNotificationDecorator
focal_method.body: @Override
      public NotificationCompat.Builder decorate(@NonNull NotificationCompat.Builder builder, @NonNull Bundle bundle) {
          if (bundle.get(IMAGE_KEY) != null) {
              try {
                  PushImage pushImage = PushImage.deserialize(bundle.get(IMAGE_KEY).toString(), Halo.instance().framework().parser());
                  Bitmap bitmapNotification = getImageBitmap(pushImage.getUrl());
                  if (bitmapNotification != null) {
                      String title = bundle.getString("title");
                      String message = bundle.getString("body");
                      RemoteViews remoteView, remoteViewExpanded;
                      switch (pushImage.getLayout()) {
                          case PushImage.DEFAULT:
                              builder.setLargeIcon(bitmapNotification);
                              break;
                          case PushImage.EXPANDED:
                              builder.setStyle(new NotificationCompat.BigPictureStyle().bigPicture(bitmapNotification));
                              break;
                          case PushImage.LEFT:
                              remoteView = getRemoteView(pushImage.getLayout(), bitmapNotification, title, message);
                              builder.setCustomContentView(remoteView);
                              break;
                          case PushImage.RIGHT:
                              remoteView = getRemoteView(pushImage.getLayout(), bitmapNotification, title, message);
                              builder.setCustomContentView(remoteView);
                              break;
                          case PushImage.TOP:
                              remoteView = getRemoteView(PushImage.LEFT, bitmapNotification, title, message);
                              builder.setCustomContentView(remoteView);
                              remoteViewExpanded = getRemoteView(pushImage.getLayout(), bitmapNotification, title, message);
                              builder.setCustomBigContentView(remoteViewExpanded);
                              break;
                          case PushImage.BOTTOM:
                              remoteView = getRemoteView(PushImage.RIGHT, bitmapNotification, title, message);
                              builder.setCustomContentView(remoteView);
                              remoteViewExpanded = getRemoteView(pushImage.getLayout(), bitmapNotification, title, message);
                              builder.setCustomBigContentView(remoteViewExpanded);
                              break;
                          case PushImage.BACKGROUND:
                              remoteView = getRemoteView(pushImage.getLayout(), bitmapNotification, title, message);
                              builder.setCustomContentView(remoteView);
                              builder.setCustomBigContentView(remoteView);
                              break;
                      }
                  }
  
              } catch (HaloParsingException e) {
                  Halog.v(NotificationImageDecorator.class, "Cannot parse the content");
              }
          }
  
          return chain(builder, bundle);
      }
focal_method.class_method_signature: NotificationImageDecorator.decorate(@NonNull NotificationCompat.Builder builder, @NonNull Bundle bundle)
focal_method.full_signature: @Override public NotificationCompat.Builder decorate(@NonNull NotificationCompat.Builder builder, @NonNull Bundle bundle)
focal_method.identifier: decorate
focal_method.invocations: get deserialize toString get parser framework instance getImageBitmap getUrl getString getString getLayout setLargeIcon setStyle bigPicture getRemoteView getLayout setCustomContentView getRemoteView getLayout setCustomContentView getRemoteView setCustomContentView getRemoteView getLayout setCustomBigContentView getRemoteView setCustomContentView getRemoteView getLayout setCustomBigContentView getRemoteView getLayout setCustomContentView setCustomBigContentView v chain
focal_method.modifiers: @Override public
focal_method.parameters: (@NonNull NotificationCompat.Builder builder, @NonNull Bundle bundle)
focal_method.return: NotificationCompat.Builder
focal_method.signature: NotificationCompat.Builder decorate(@NonNull NotificationCompat.Builder builder, @NonNull Bundle bundle)