Search in sources :

Example 1 with CoverOverlayDrawable

use of im.actor.sdk.view.avatar.CoverOverlayDrawable in project actor-platform by actorapp.

the class CoverAvatarView method init.

private void init() {
    if (isInEditMode()) {
        return;
    }
    GenericDraweeHierarchyBuilder builder = new GenericDraweeHierarchyBuilder(getResources());
    builder.setActualImageScaleType(ScalingUtils.ScaleType.CENTER_CROP);
    builder.setOverlay(new CoverOverlayDrawable(getContext()));
    if (ActorSDK.sharedActor().style.getAvatarBackgroundResourse() != 0) {
        builder.setPlaceholderImage(getResources().getDrawable(ActorSDK.sharedActor().style.getAvatarBackgroundResourse()), ScalingUtils.ScaleType.CENTER_CROP);
    } else {
        builder.setPlaceholderImage(new ColorDrawable(ActorSDK.sharedActor().style.getAvatarBackgroundColor()));
    }
    builder.setFadeDuration(0);
    setHierarchy(builder.build());
}
Also used : ColorDrawable(android.graphics.drawable.ColorDrawable) GenericDraweeHierarchyBuilder(com.facebook.drawee.generic.GenericDraweeHierarchyBuilder) CoverOverlayDrawable(im.actor.sdk.view.avatar.CoverOverlayDrawable)

Aggregations

ColorDrawable (android.graphics.drawable.ColorDrawable)1 GenericDraweeHierarchyBuilder (com.facebook.drawee.generic.GenericDraweeHierarchyBuilder)1 CoverOverlayDrawable (im.actor.sdk.view.avatar.CoverOverlayDrawable)1