ProfileScreenViewModel

interface ProfileScreenViewModel

An interface that contains the required methods and properties for a concrete implementation of ProfileScreenViewModel.

Types

Link copied to clipboard
enum UiState : Enum<ProfileScreenViewModel.UiState>

An enum class the consists of the different UI states associated with ProfileScreenViewModel.

Link copied to clipboard
enum UpdateAttribute : Enum<ProfileScreenViewModel.UpdateAttribute>

An enum class that contains the user attributes that can be updated.

Functions

Link copied to clipboard
abstract fun isValidEmail(email: String): Boolean

A method that returns true if the specified email is a valid email. If it is not a valid email, it will return false.

Link copied to clipboard
abstract fun isValidPassword(password: String): Boolean

A method that returns true if the specified password is a valid password. If it is not a valid password, it will return false.

Link copied to clipboard
abstract fun updateAttributeForCurrentUser(    updateAttribute: ProfileScreenViewModel.UpdateAttribute,     newValue: String,     resetStateTimeOut: Long = defaultResetStateTimeOut)

Used to update the specified updateAttribute to the newValue for the current user.

Link copied to clipboard
abstract fun updateProfilePicture(imageBitmap: ImageBitmap, resetStateTimeOut: Long = defaultResetStateTimeOut)

Used to update the profile picture of the currently logged in user with the specified imageBitmap.

Properties

Link copied to clipboard
abstract val uiState: State<ProfileScreenViewModel.UiState>

A state property that contains the UI state of ProfileScreenViewModel.

Inheritors

Link copied to clipboard

Extensions

Link copied to clipboard
fun ProfileScreenViewModel.updateEmail(newEmail: String, resetStateTimeOut: Long = defaultResetStateTimeOut)

A utility method that is used to update the email of the currently logged-in user with the newEmail. This extension method is a shorthand for the ProfileScreenViewModel.updateAttributeForCurrentUser. It removes the need for specifying the 'updateAttribute' param of the ProfileScreenViewModel.updateAttributeForCurrentUser method.

Link copied to clipboard
fun ProfileScreenViewModel.updateName(newName: String, resetStateTimeOut: Long = defaultResetStateTimeOut)

A utility method that is used to update the name of the currently logged-in user with the newName. This extension method is a shorthand for the ProfileScreenViewModel.updateAttributeForCurrentUser. It removes the need for specifying the 'updateAttribute' param of the ProfileScreenViewModel.updateAttributeForCurrentUser method.

Link copied to clipboard
fun ProfileScreenViewModel.updatePassword(newPassword: String, resetStateTimeOut: Long = defaultResetStateTimeOut)

A utility method that is used to update the password of the currently logged-in user with the newPassword. This extension method is a shorthand for the ProfileScreenViewModel.updateAttributeForCurrentUser. It removes the need for specifying the 'updateAttribute' param of the ProfileScreenViewModel.updateAttributeForCurrentUser method.