Profile Screen View Model

class ProfileScreenViewModel(snackbarHostState: SnackbarHostState) : EquinoxViewModel

The ProfileActivityViewModel class is the support class used by the ProfileScreen to change the user account settings or preferences

Author

N7ghtm4r3 - Tecknobit

Parameters

snackbarHostState

: the host to launch the snackbar messages

See also

EquinoxViewModel
ViewModel
FetcherManagerWrapper

Constructors

Link copied to clipboard
constructor(snackbarHostState: SnackbarHostState)

Properties

Link copied to clipboard
lateinit var newEmail: MutableState<String>

newEmail -> the value of the new email to set

Link copied to clipboard
lateinit var newEmailError: MutableState<Boolean>

newEmailError -> whether the newEmail field is not valid

Link copied to clipboard
lateinit var newPassword: MutableState<String>

newPassword -> the value of the new password to set

Link copied to clipboard
lateinit var newPasswordError: MutableState<Boolean>

newPasswordError -> whether the newPassword field is not valid

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
open override fun canRefresherStart(): Boolean
Link copied to clipboard
fun changeEmail(onSuccess: () -> Unit)

Function to execute the email change

Link copied to clipboard
fun changeLanguage(newLanguage: String, onSuccess: () -> Unit)

Function to execute the language change

Link copied to clipboard
fun changePassword(onSuccess: () -> Unit)

Function to execute the password change

Link copied to clipboard
fun changeProfilePic(imagePath: String, profilePic: MutableState<String>)

Function to execute the profile pic change

Link copied to clipboard
fun changeTheme(newTheme: EquinoxUser.ApplicationTheme, onChange: () -> Unit)

Function to execute the theme change

Link copied to clipboard
fun clearSession(onClear: () -> Unit)

Method to clear the current localUser session

Link copied to clipboard
open override fun continueToFetch(currentContext: Class<*>): Boolean
Link copied to clipboard
fun deleteAccount(onDelete: () -> Unit)

Function to execute the account deletion

Link copied to clipboard
open override fun execRefreshingRoutine(currentContext: Class<*>, routine: () -> Unit, repeatRoutine: Boolean, refreshDelay: Long)
Link copied to clipboard
Link copied to clipboard
open override fun restartRefresher()
Link copied to clipboard
open fun setActiveContext(currentContext: Class<*>)
Link copied to clipboard
open override fun suspendRefresher()
Link copied to clipboard
fun SuspendUntilElementOnScreen(elementVisible: MutableState<Boolean>)