@Test public void load_withBitmapResourceId_asDrawable_producesNonNullDrawable() throws ExecutionException, InterruptedException { Drawable drawable = Glide.with(context) .load(android.R.drawable.star_big_off) .submit() .get(); assertThat(drawable).isNotNull(); }
@Test public void load_withBitmapAliasResourceId_asDrawable_producesNonNullDrawable() throws ExecutionException, InterruptedException { Drawable drawable = Glide.with(context) .load(ResourceIds.drawable.bitmap_alias) .submit() .get(); assertThat(drawable).isNotNull(); }
@Test public void load_withVectorDrawableResourceId_asDrawable_producesNonNullDrawable() throws ExecutionException, InterruptedException { Drawable drawable = Glide.with(context) .load(ResourceIds.drawable.vector_drawable) .submit() .get(); assertThat(drawable).isNotNull(); }
@Test public void load_withShapeDrawableResourceId_asDrawable_producesNonNullDrawable() throws ExecutionException, InterruptedException { Drawable drawable = Glide.with(context) .load(ResourceIds.drawable.shape_drawable) .submit() .get(); assertThat(drawable).isNotNull(); }
@Test public void load_withStateListDrawableResourceId_asDrawable_producesNonNullDrawable() throws ExecutionException, InterruptedException { Drawable drawable = Glide.with(context) .load(ResourceIds.drawable.state_list_drawable) .submit() .get(); assertThat(drawable).isNotNull(); }
@Override public void run() throws Throwable { Glide.with(context) .load(ResourceIds.drawable.shape_drawable) .apply(centerCropTransform()) .submit() .get(); } });
@Override public void run() throws Throwable { Glide.with(context) .asBitmap() .load(ResourceIds.drawable.shape_drawable) .submit() .get(); } });
@Override public void run() throws Throwable { Glide.with(context) .load(colorDrawable) .apply(new RequestOptions() .centerCrop()) .submit() .get(); } });
@Test public void load_withShapeDrawableResourceId_asBitmap_withValidSize_returnsNonNullBitmap() throws ExecutionException, InterruptedException { Bitmap bitmap = Glide.with(context) .asBitmap() .load(ResourceIds.drawable.shape_drawable) .submit(100, 200) .get(); assertThat(bitmap).isNotNull(); assertThat(bitmap.getWidth()).isEqualTo(100); assertThat(bitmap.getHeight()).isEqualTo(200); }
@Test public void load_withShapeDrawableResourceId_asDrawable_withTransformation_validSize_succeeds() throws ExecutionException, InterruptedException { Drawable drawable = Glide.with(context) .load(ResourceIds.drawable.shape_drawable) .apply(bitmapTransform(new RoundedCorners(10))) .submit(100, 200) .get(); assertThat(drawable).isNotNull(); assertThat(drawable.getIntrinsicWidth()).isEqualTo(100); assertThat(drawable.getIntrinsicHeight()).isEqualTo(200); }
@Test public void load_withStateListDrawableResourceId_asDrawable_withTransformation_nonNullDrawable() throws ExecutionException, InterruptedException { Drawable drawable = Glide.with(context) .load(ResourceIds.drawable.state_list_drawable) .apply(centerCropTransform()) .submit() .get(); assertThat(drawable).isNotNull(); }
@Test public void load_withVectorDrawableResourceId_asDrawable_withTransformation_nonNullDrawable() throws ExecutionException, InterruptedException { Drawable drawable = Glide.with(context) .load(ResourceIds.drawable.vector_drawable) .apply(centerCropTransform()) .submit() .get(); assertThat(drawable).isNotNull(); }
@Test public void load_withBitmapAliasResourceId_asDrawable_withTransformation_producesNonNullDrawable() throws ExecutionException, InterruptedException { Drawable drawable = Glide.with(context) .load(ResourceIds.drawable.bitmap_alias) .apply(centerCropTransform()) .submit() .get(); assertThat(drawable).isNotNull(); }
@Test public void load_withNinePatchResourceId_asBitmap_producesNonNullBitmap() throws ExecutionException, InterruptedException { Bitmap bitmap = Glide.with(context) .asBitmap() .load(ResourceIds.drawable.googlelogo_color_120x44dp) .submit() .get(); assertThat(bitmap).isNotNull(); }
@Test public void load_withBitmapAliasResourceId_asBitmap_producesNonNullBitmap() throws ExecutionException, InterruptedException { Bitmap bitmap = Glide.with(context) .asBitmap() .load(ResourceIds.drawable.bitmap_alias) .submit() .get(); assertThat(bitmap).isNotNull(); }
@Test public void load_withStateListDrawableResourceId_asBitmap_producesNonNullBitmap() throws ExecutionException, InterruptedException { Bitmap bitmap = Glide.with(context) .asBitmap() .load(ResourceIds.drawable.state_list_drawable) .submit() .get(); assertThat(bitmap).isNotNull(); }
@Test public void load_withStateListDrawableResourceId_asBitmap_withTransformation_nonNullBitmap() throws ExecutionException, InterruptedException { Bitmap bitmap = Glide.with(context) .asBitmap() .load(ResourceIds.drawable.state_list_drawable) .apply(centerCropTransform()) .submit() .get(); assertThat(bitmap).isNotNull(); }
@Test public void load_withVectorDrawableResourceId_asBitmap_withTransformation_producesNonNullBitmap() throws ExecutionException, InterruptedException { Bitmap bitmap = Glide.with(context) .asBitmap() .load(ResourceIds.drawable.vector_drawable) .apply(centerCropTransform()) .submit() .get(); assertThat(bitmap).isNotNull(); }
@Test public void load_withNinePatchResourceId_asBitmap_withTransformation_producesNonNullBitmap() throws ExecutionException, InterruptedException { Bitmap bitmap = Glide.with(context) .asBitmap() .load(ResourceIds.drawable.googlelogo_color_120x44dp) .apply(centerCropTransform()) .submit() .get(); assertThat(bitmap).isNotNull(); }
@Override public void run() throws Throwable { GlideApp .with(context) .asBitmap() .load(canonical.getBitmap()) .fitCenter() .override(overrideWidth, overrideHeight) .submit() .get(); } });