ConnectViewModel

class ConnectViewModel(val context: Context, snackbarHostState: SnackbarHostState) : EquinoxViewModel

The ConnectViewModel class is the support class used by the ConnectActivity to execute the authentication requests to the backend

Author

N7ghtm4r3 - Tecknobit

Parameters

snackbarHostState

: the host to launch the snackbar messages

context

: the current context where this model has been created

See also

EquinoxViewModel
FetcherManager.FetcherManagerWrapper

Constructors

Link copied to clipboard
constructor(context: Context, snackbarHostState: SnackbarHostState)

Properties

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

email -> the email of the user

Link copied to clipboard

emailError -> whether the email field is not valid

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

host -> the value of the host to reach

Link copied to clipboard

hostError -> whether the host field is not valid

Link copied to clipboard

isSignUp -> whether the auth request to execute is sign up or sign in

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

name -> the name of the user

Link copied to clipboard

nameError -> whether the name field is not valid

Link copied to clipboard

password -> the password of the user

Link copied to clipboard

passwordError -> whether the password field is not valid

Link copied to clipboard

serverSecret -> the value of the server secret

Link copied to clipboard

serverSecretError -> whether the serverSecret field is not valid

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

surname -> the surname of the user

Link copied to clipboard

surnameError -> whether the surname field is not valid

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

tagName -> the tag name of the user

Link copied to clipboard

nameError -> whether the tagName field is not valid

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun auth()

Wrapper function to execute the specific authentication request

Link copied to clipboard
open override fun canRefresherStart(): Boolean
Link copied to clipboard
open override fun continueToFetch(currentContext: Class<*>): Boolean
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