HaloCloudinary { @NonNull @Api(1.1) public String url() { return mTransformedUrl; } HaloCloudinary(@NonNull final String url); @Api(1.1) static Builder builder(); @NonNull @Api(1.1) String url(); @Override String toString(); @Api(1.1)
    static final String CROP_MODE_SCALE; @Api(1.1)
    static final String CROP_MODE_FIT; @Api(1.1)
    static final String CROP_MODE_LIMIT; @Api(1.1)
    static final String CROP_MODE_SCALE_FIT; @Api(1.1)
    static final String CROP_MODE_FILL; @Api(1.1)
    static final String CROP_MODE_LARGE_FILL; @Api(1.1)
    static final String CROP_MODE_PAD; @Api(1.1)
    static final String CROP_MODE_LARGE_PAD; @Api(1.1)
    static final String CROP_MODE_SCALE_PAD; @Api(1.1)
    static final String CROP_MODE_CROP; @Api(1.1)
    static final String CROP_MODE_THUMB; @Api(1.1)
    static final String CROP_MODE_AOI_CROP; @Api(1.1)
    static final String CROP_MODE_AOI_SCALE; @Api(1.1)
    static final String IMAGE_GRAVITY_NORTH_WEST; @Api(1.1)
    static final String IMAGE_GRAVITY_NORTH; @Api(1.1)
    static final String IMAGE_GRAVITY_NORTH_EAST; @Api(1.1)
    static final String IMAGE_GRAVITY_WEST; @Api(1.1)
    static final String IMAGE_GRAVITY_CENTER; @Api(1.1)
    static final String IMAGE_GRAVITY_EAST; @Api(1.1)
    static final String IMAGE_GRAVITY_SOUTH_WEST; @Api(1.1)
    static final String IMAGE_GRAVITY_SOUTH; @Api(1.1)
    static final String IMAGE_GRAVITY_SOUTH_EAST; @Api(1.1)
    static final String IMAGE_GRAVITY_XY_CENTER; @Api(1.1)
    static final String IMAGE_GRAVITY_FACE; @Api(1.1)
    static final String IMAGE_GRAVITY_FACE_CENTER; @Api(1.1)
    static final String IMAGE_GRAVITY_FACES; @Api(1.1)
    static final String IMAGE_GRAVITY_FACES_CENTER; @Api(1.1)
    static final String IMAGE_GRAVITY_LARGEST_FACE; @Api(1.1)
    static final String IMAGE_GRAVITY_ALL_FACES; @Api(1.1)
    static final String IMAGE_GRAVITY_LARGEST_EYES; @Api(1.1)
    static final String IMAGE_GRAVITY_CUSTOM; @Api(1.1)
    static final String IMAGE_GRAVITY_CUSTOM_FACE; @Api(1.1)
    static final String IMAGE_GRAVITY_CUSTOM_FACES; @Api(1.1)
    static final String IMAGE_GRAVITY_CUSTOM_LARGEST_FACE; @Api(1.1)
    static final String IMAGE_GRAVITY_CUSTOM_ALL_FACES; @Api(1.1)
    static final String IMAGE_FLAG_KEEP_IPTC; @Api(1.1)
    static final String IMAGE_FLAG_ATTACHMENT; @Api(1.1)
    static final String IMAGE_FLAG_RELATIVE; @Api(1.1)
    static final String IMAGE_FLAG_REGION_RELATIVE; @Api(1.1)
    static final String IMAGE_FLAG_PROGRESSIVE; @Api(1.1)
    static final String IMAGE_FLAG_PNG_8; @Api(1.1)
    static final String IMAGE_FLAG_FORCE_STRIP; @Api(1.1)
    static final String IMAGE_FLAG_CUTTER; @Api(1.1)
    static final String IMAGE_FLAG_CLIP; @Api(1.1)
    static final String IMAGE_FLAG_AWEBP; @Api(1.1)
    static final String IMAGE_FLAG_LAYER_APPLY; @Api(1.1)
    static final String IMAGE_FLAG_IGNORE_ASPECT_RATIO; @Api(1.1)
    static final String IMAGE_FLAG_TILED; @Api(1.1)
    static final String IMAGE_FLAG_LOSSY; @Api(1.1)
    static final String IMAGE_FLAG_STRIP_PROFILE; @Api(1.1)
    static final String IMAGE_FLAG_RASTERIZE; @Api(1.1)
    static final String IMAGE_FLAG_TEXT_NO_TRIM; }
@Test public void thatCloudinaryUrlIsInvalid() { String invalidUrl = CLOUD_URL.replace("upload", "uplad"); assertThat(mBuilder.aspectRatio(1).build(invalidUrl).url()).isEqualTo(invalidUrl); }
@Test public void thatDelayAnimation() { assertThat(mBuilder.delay(27).build(CLOUD_URL).url().contains("dl_27")).isTrue(); }
@Test public void thatHaveDefaultImage() { assertThat(mBuilder.defaultImage("default").build(CLOUD_URL).url().contains("d_default")).isTrue(); reloadBuilder(); assertThat(mBuilder.defaultImage(null).build(CLOUD_URL).url().contains("d_")).isFalse(); }
@Test public void thatAddAUnderlayImage() { assertThat(mBuilder.underlay("default").build(CLOUD_URL).url().contains("u_default")).isTrue(); reloadBuilder(); assertThat(mBuilder.underlay(null).build(CLOUD_URL).url().contains("u_")).isFalse(); }
@Test public void thatAddAOverlay() { assertThat(mBuilder.overlay("default").build(CLOUD_URL).url().contains("l_default")).isTrue(); reloadBuilder(); assertThat(mBuilder.overlay(null).build(CLOUD_URL).url().contains("l_")).isFalse(); }
@Test public void thatAddOverlayText() { assertThat(mBuilder.overlayText("default").build(CLOUD_URL).url().contains("l_text:default")).isTrue(); reloadBuilder(); assertThat(mBuilder.overlayText(null).build(CLOUD_URL).url().contains("l_text")).isFalse(); }
@Test public void thatBackgroundColorRGBIsValid() { assertThat(mBuilder.backgroundColorRGB("#000000").build(CLOUD_URL).url().contains("b_rgb:#000000")).isTrue(); reloadBuilder(); assertThat(mBuilder.backgroundColorRGB(null).build(CLOUD_URL).url().contains("b_rgb")).isFalse(); }
@Test public void thatBackgroundColorIsValid() { assertThat(mBuilder.backgroundColor("white").build(CLOUD_URL).url().contains("b_white")).isTrue(); reloadBuilder(); assertThat(mBuilder.backgroundColor(null).build(CLOUD_URL).url().contains("b_")).isFalse(); }
@Test public void thatAddABorder() { assertThat(mBuilder.border("dotted").build(CLOUD_URL).url().contains("bo_dotted")).isTrue(); reloadBuilder(); assertThat(mBuilder.border(null).build(CLOUD_URL).url().contains("b_")).isFalse(); }
@Test public void thatCanChangeOpacity() { assertThat(mBuilder.opacity(2).build(CLOUD_URL).url().contains("o_2")).isTrue(); }
@Test public void thatCanSetMaxRadius() { assertThat(mBuilder.maxRadius().build(CLOUD_URL).url().contains("r_max")).isTrue(); }
@Test public void thatCloudinaryUrlWithEmptyParams() { String invalidUrl = CLOUD_URL.replace("upload", "uplad"); assertThat(mBuilder.build(invalidUrl).url()).isEqualTo(invalidUrl); }
@Test public void thatCanSetRadius() { assertThat(mBuilder.radius(2).build(CLOUD_URL).url().contains("r_2")).isTrue(); }
@Test public void thatControlQualityCompression() { assertThat(mBuilder.quality(0.3f).build(CLOUD_URL).url().contains("q_0.3")).isTrue(); }
@Test public void thatCanSetYPosByPercentage() { assertThat(mBuilder.yPos(0.3f).build(CLOUD_URL).url().contains("y_0.3")).isTrue(); }
@Test public void thatCanSetYPosInPixels() { assertThat(mBuilder.yPos(17).build(CLOUD_URL).url().contains("y_17")).isTrue(); }
@Test public void thatXCanSetPosByPercentage() { assertThat(mBuilder.xPos(0.3f).build(CLOUD_URL).url().contains("x_0.3")).isTrue(); }
@Test public void thatCansetYPosInPixels() { assertThat(mBuilder.xPos(17).build(CLOUD_URL).url().contains("x_17")).isTrue(); }
@Test public void thatCanSetZoomPos() { assertThat(mBuilder.zoom(20).build(CLOUD_URL).url().contains("z_20")).isTrue(); }
@Test public void thatCanSetGravityPositionToCropMode() { assertThat(mBuilder.gravity(HaloCloudinary.IMAGE_GRAVITY_ALL_FACES).build(CLOUD_URL).url().contains("g_" + HaloCloudinary.IMAGE_GRAVITY_ALL_FACES)).isTrue(); reloadBuilder(); assertThat(mBuilder.gravity(null).build(CLOUD_URL).url().contains("g_")).isFalse(); }
@Test public void thatCanSetAspectRatio() { assertThat(mBuilder.aspectRatio("10:10").build(CLOUD_URL).url().contains("ar_10:10")).isTrue(); }
@Test public void thatCanSetAspectRatioByPercentage() { assertThat(mBuilder.aspectRatio(0.2f).build(CLOUD_URL).url().contains("ar_0.2")).isTrue(); }
@Test public void thatParcelBuilder() { String resultingUrl = mBuilder.aspectRatio(1).build(CLOUD_URL).url(); String afterParse = TestUtils.testParcel(mBuilder, HaloCloudinary.Builder.CREATOR).build(CLOUD_URL).url(); assertThat(afterParse).isEqualTo(resultingUrl); assertThat(mBuilder.describeContents()).isEqualTo(0); }
@Test public void thatCanCropImage() { assertThat(mBuilder.crop(HaloCloudinary.CROP_MODE_AOI_CROP).build(CLOUD_URL).url().contains("c_" + HaloCloudinary.CROP_MODE_AOI_CROP)).isTrue(); reloadBuilder(); assertThat(mBuilder.crop(null).build(CLOUD_URL).url().contains("c_")).isFalse(); }
@Test public void thatCanSetHeightInPixels() { assertThat(mBuilder.height(20).build(CLOUD_URL).url().contains("h_20")).isTrue(); }
@Test public void thatCanSetHeightByPercentage() { assertThat(mBuilder.height(0.5f).build(CLOUD_URL).url().contains("h_0.5")).isTrue(); }
@Test public void thatCanSetWidthInPixels() { assertThat(mBuilder.width(20).build(CLOUD_URL).url().contains("w_20")).isTrue(); }
@Test public void thatCanSetWidthByPercentage() { assertThat(mBuilder.width(0.5f).build(CLOUD_URL).url().contains("w_0.5")).isTrue(); }
@Test public void thatNamedTransformation() { assertThat(mBuilder.namedTransformation("myTransform").build(CLOUD_URL).url().contains("t_myTransform")).isTrue(); reloadBuilder(); assertThat(mBuilder.namedTransformation(null).build(CLOUD_URL).url().contains("t_")).isFalse(); }
@Test public void thatAddAFlag() { assertThat(mBuilder.addFlags(HaloCloudinary.IMAGE_FLAG_ATTACHMENT).build(CLOUD_URL).url().contains("fl_" + HaloCloudinary.IMAGE_FLAG_ATTACHMENT)).isTrue(); reloadBuilder(); assertThat(mBuilder.addFlags().build(CLOUD_URL).url().contains("fl_")).isFalse(); }
@Test public void thatDpiIsOk() { assertThat(mBuilder.dpi(27).build(CLOUD_URL).url().contains("dn_" + 27)).isTrue(); }
@Test public void thatPage() { assertThat(mBuilder.page(7).build(CLOUD_URL).url().contains("pg_" + 7)).isTrue(); }
@Test public void thatDevicePixelRatioIsOk() { assertThat(mBuilder.devicePixelRatio(2).build(CLOUD_URL).url().contains("dpr_" + 2)).isTrue(); }
@Test public void thatColorRgbIsValid() { assertThat(mBuilder.colorRGB("#000000").build(CLOUD_URL).url().contains("co_rgb:#000000")).isTrue(); reloadBuilder(); assertThat(mBuilder.colorRGB(null).build(CLOUD_URL).url().contains("co_rgb")).isFalse(); }
@Test public void thatColorNameIsValid() { assertThat(mBuilder.color("white").build(CLOUD_URL).url().contains("co_white")).isTrue(); reloadBuilder(); assertThat(mBuilder.color(null).build(CLOUD_URL).url().contains("co_")).isFalse(); }