use of com.facebook.drawee.drawable.FadeDrawable in project fresco by facebook.
the class GenericDraweeHierarchyTest method testSetRoundingParams_ToRoundedLeafsFrom.
private void testSetRoundingParams_ToRoundedLeafsFrom(RoundingParams prev) {
RoundingParams roundingParams = RoundingParams.asCircle().setBorder(0xAAAAAAAA, 4);
GenericDraweeHierarchy dh = testRoundingParams_createHierarchy(prev, roundingParams);
RootDrawable rootDrawable = (RootDrawable) dh.getTopLevelDrawable();
FadeDrawable fadeDrawable = (FadeDrawable) rootDrawable.getCurrent();
testRoundingParams_RoundedLeafs(rootDrawable, fadeDrawable, roundingParams);
}
use of com.facebook.drawee.drawable.FadeDrawable in project fresco by facebook.
the class GenericDraweeHierarchyTest method testHierarchy_NoBranches.
@Test
public void testHierarchy_NoBranches() throws Exception {
GenericDraweeHierarchy dh = mBuilder.build();
RootDrawable rootDrawable = (RootDrawable) dh.getTopLevelDrawable();
FadeDrawable fadeDrawable = (FadeDrawable) rootDrawable.getCurrent();
assertEquals(7, fadeDrawable.getNumberOfLayers());
assertNull(fadeDrawable.getDrawable(0));
assertNull(fadeDrawable.getDrawable(1));
assertActualImageScaleType(ScaleType.CENTER_CROP, null, fadeDrawable.getDrawable(2));
assertNull(fadeDrawable.getDrawable(3));
assertNull(fadeDrawable.getDrawable(4));
assertNull(fadeDrawable.getDrawable(5));
assertNull(fadeDrawable.getDrawable(6));
verifyCallback(rootDrawable, fadeDrawable);
}
use of com.facebook.drawee.drawable.FadeDrawable in project fresco by facebook.
the class GenericDraweeHierarchyTest method testHierarchy_WithScaleType.
@Test
public void testHierarchy_WithScaleType() throws Exception {
GenericDraweeHierarchy dh = mBuilder.setPlaceholderImage(mPlaceholderImage, ScaleType.CENTER).setRetryImage(mRetryImage, ScaleType.FIT_CENTER).setFailureImage(mFailureImage, ScaleType.CENTER_INSIDE).setProgressBarImage(mProgressBarImage, ScaleType.CENTER).setActualImageScaleType(ScaleType.FOCUS_CROP).setActualImageFocusPoint(mFocusPoint).build();
RootDrawable rootDrawable = (RootDrawable) dh.getTopLevelDrawable();
FadeDrawable fadeDrawable = (FadeDrawable) rootDrawable.getCurrent();
assertEquals(7, fadeDrawable.getNumberOfLayers());
assertNull(fadeDrawable.getDrawable(0));
assertScaleTypeAndDrawable(mPlaceholderImage, ScaleType.CENTER, fadeDrawable.getDrawable(1));
assertActualImageScaleType(ScaleType.FOCUS_CROP, mFocusPoint, fadeDrawable.getDrawable(2));
assertScaleTypeAndDrawable(mProgressBarImage, ScaleType.CENTER, fadeDrawable.getDrawable(3));
assertScaleTypeAndDrawable(mRetryImage, ScaleType.FIT_CENTER, fadeDrawable.getDrawable(4));
assertScaleTypeAndDrawable(mFailureImage, ScaleType.CENTER_INSIDE, fadeDrawable.getDrawable(5));
assertNull(fadeDrawable.getDrawable(6));
verifyCallback(rootDrawable, mPlaceholderImage);
}
use of com.facebook.drawee.drawable.FadeDrawable in project fresco by facebook.
the class GenericDraweeHierarchyTest method testHierarchy_WithFailureImage.
@Test
public void testHierarchy_WithFailureImage() throws Exception {
GenericDraweeHierarchy dh = mBuilder.setFailureImage(mFailureImage, ScaleType.CENTER).build();
RootDrawable rootDrawable = (RootDrawable) dh.getTopLevelDrawable();
FadeDrawable fadeDrawable = (FadeDrawable) rootDrawable.getCurrent();
assertScaleTypeAndDrawable(mFailureImage, ScaleType.CENTER, fadeDrawable.getDrawable(5));
verifyCallback(rootDrawable, mFailureImage);
}
use of com.facebook.drawee.drawable.FadeDrawable in project fresco by facebook.
the class GenericDraweeHierarchyTest method testHierarchy_WithBackground.
@Test
public void testHierarchy_WithBackground() throws Exception {
GenericDraweeHierarchy dh = mBuilder.setBackground(mBackground).build();
RootDrawable rootDrawable = (RootDrawable) dh.getTopLevelDrawable();
FadeDrawable fadeDrawable = (FadeDrawable) rootDrawable.getCurrent();
assertEquals(7, fadeDrawable.getNumberOfLayers());
assertSame(mBackground, fadeDrawable.getDrawable(0));
verifyCallback(rootDrawable, mBackground);
}
Aggregations