Package com.example.oblong
Class ProfilePicGenerator
java.lang.Object
com.example.oblong.ProfilePicGenerator
Utility class for generating profile pictures with a random background color
and the first letter of a given name.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic android.graphics.Bitmap
generateProfilePic
(String name) Generates a Bitmap representing a profile picture.
-
Constructor Details
-
ProfilePicGenerator
public ProfilePicGenerator()
-
-
Method Details
-
generateProfilePic
Generates a Bitmap representing a profile picture. The picture is a square with a random background color and the first letter of the provided name displayed in white at the center.- Parameters:
name
- The name to extract the first letter from. If the name is null or empty, a "?" will be displayed instead.- Returns:
- A
Bitmap
object representing the generated profile picture.
-