Search in sources :

Example 1 with CropCircleTransformation

use of com.toshi.view.custom.CropCircleTransformation in project toshi-android-client by toshiapp.

the class ImageUtil method loadNotificationIcon.

public static Bitmap loadNotificationIcon(final Recipient recipient) throws ExecutionException, InterruptedException {
    final RequestManager requestManager = Glide.with(BaseApplication.get());
    final DrawableTypeRequest typeRequest = recipient.isGroup() ? requestManager.load(recipient.getGroupAvatar().getBytes()) : requestManager.load(recipient.getUserAvatar());
    return (Bitmap) typeRequest.asBitmap().transform(new CropCircleTransformation(BaseApplication.get())).into(200, 200).get();
}
Also used : Bitmap(android.graphics.Bitmap) RequestManager(com.bumptech.glide.RequestManager) CropCircleTransformation(com.toshi.view.custom.CropCircleTransformation) DrawableTypeRequest(com.bumptech.glide.DrawableTypeRequest)

Aggregations

Bitmap (android.graphics.Bitmap)1 DrawableTypeRequest (com.bumptech.glide.DrawableTypeRequest)1 RequestManager (com.bumptech.glide.RequestManager)1 CropCircleTransformation (com.toshi.view.custom.CropCircleTransformation)1