Class Profile
java.lang.Object
com.example.slacks_lottoevent.model.Profile
Represents a user profile with basic information.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateProfilePicture(String name, android.content.Context context) Generates and saves a profile picture image with the initials of the name.booleangetAdmin()booleangetEmail()getName()getPhone()booleanvoidsetAdmin(boolean admin) voidsetAdminNotifications(boolean adminNotifications) voidvoidSets the name of the user and updates the profile picture if using the default picture.voidvoidsetProfilePicturePath(String profilePicturePath) voidsetUsingDefaultPicture(boolean usingDefaultPicture)
-
Constructor Details
-
Profile
public Profile()Default constructor for Firestore serialization. -
Profile
public Profile(String name, String phone, String email, String deviceId, android.content.Context context) Constructor for creating a new profile.- Parameters:
name- The name of the user.phone- The phone number of the user.email- The email address of the user.context- The application context for file access.
-
-
Method Details
-
getName
-
setName
Sets the name of the user and updates the profile picture if using the default picture.- Parameters:
name- The name of the user.context- The application context for file access.
-
getEmail
-
setEmail
-
getPhone
-
setPhone
-
getDeviceId
-
getAdminNotifications
public boolean getAdminNotifications() -
setAdminNotifications
public void setAdminNotifications(boolean adminNotifications) -
getUsingDefaultPicture
public boolean getUsingDefaultPicture() -
setUsingDefaultPicture
public void setUsingDefaultPicture(boolean usingDefaultPicture) -
getProfilePicturePath
-
setProfilePicturePath
-
generateProfilePicture
Generates and saves a profile picture image with the initials of the name.- Parameters:
name- The name to extract initials from.context- The application context for accessing file storage.- Returns:
- The file path of the saved profile picture.
-
getAdmin
public boolean getAdmin() -
setAdmin
public void setAdmin(boolean admin)
-