Package 

Class AvatarBitmapFactory

  • All Implemented Interfaces:

    
    public class AvatarBitmapFactory
    
                        

    A Bitmap factory to create avatar bitmaps.

    • Constructor Detail

      • AvatarBitmapFactory

        AvatarBitmapFactory(Context context)
    • Method Detail

      • loadAvatarBitmapBlocking

         Bitmap loadAvatarBitmapBlocking(Object data, Avatar avatar, @Px() Integer avatarSize)

        Creates a Bitmap to represent an avatar image.

        This method takes precedence over loadAvatarBitmap if both are implemented.

        Override this method only if you can't provide a suspending implementation, otherwise override loadAvatarBitmap instead.

        Parameters:
        data - An image request model.
        avatar - An Avatar data model which includes request model and avatar styles.
        avatarSize - A specified avatar size.
      • loadAvatarBitmap

         Bitmap loadAvatarBitmap(Object data, Avatar avatar, @Px() Integer avatarSize)

        Loads a Bitmap with the image request data to represent the avatar in a suspending operation.

        This method requests images by using the ImageLoader on an IO coroutines scope. The loadAvatarBitmapBlocking method takes precedence over this one if both are implemented. Prefer implementing this method if possible.

        Parameters:
        data - An image request model.
        avatar - An Avatar data model which includes request model and avatar styles.
        avatarSize - A specified avatar size.
      • loadAvatarPlaceholderBitmapBlocking

         Bitmap loadAvatarPlaceholderBitmapBlocking(Object data, Avatar avatar, @Px() Integer avatarSize)

        Loads a Bitmap with the avatar to represent the placeholder of the avatar in a suspending operation. This method will be executed if the previous image request failed.

        This method takes precedence over loadAvatarPlaceholderBitmap if both are implemented.

        Override this method only if you can't provide a suspending implementation, otherwise override loadAvatarPlaceholderBitmap instead.

        Parameters:
        data - An image request model.
        avatar - An Avatar data model which includes request model and avatar styles.
        avatarSize - A specified avatar size.
      • loadAvatarPlaceholderBitmap

         Bitmap loadAvatarPlaceholderBitmap(Object data, Avatar avatar, @Px() Integer avatarSize)

        Loads a Bitmap with the avatar to represent the placeholder of the avatar in a suspending operation. This method will be executed if the previous image request failed.

        The loadAvatarPlaceholderBitmapBlocking method takes precedence over this one if both are implemented. Prefer implementing this method if possible.

        Parameters:
        data - An image request model.
        avatar - An Avatar data model which includes request model and avatar styles.
        avatarSize - A specified avatar size.
      • createAvatarBitmaps

         Bitmap createAvatarBitmaps(Avatar avatar, @Px() Integer avatarSize)

        Creates a combined avatar Bitmap with the data model avatar and the specified avatarSize to represent the avatar image, in a suspending operation.

        Parameters:
        avatar - An Avatar data model which includes request model and avatar styles.
        avatarSize - A specified avatar size.