Package com.example.iconic_raffleevent
Class AvatarGenerator
java.lang.Object
com.example.iconic_raffleevent.AvatarGenerator
Utility class for generating circular avatar images with initials.
This class provides methods to create avatars based on a user's name, generating a unique color and initials
for each avatar. It draws a colored circle with initials centered within it.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic android.graphics.Bitmap
generateAvatar
(String name, int size) Generates a circular avatar bitmap with the initials of the provided name.
-
Constructor Details
-
AvatarGenerator
public AvatarGenerator()
-
-
Method Details
-
generateAvatar
Generates a circular avatar bitmap with the initials of the provided name.- Parameters:
name
- The name from which to generate the avatar initials. If null or empty, an empty avatar will be created.size
- The size (width and height) of the generated avatar bitmap in pixels.- Returns:
- A
Bitmap
representing the generated avatar image.
-