Create Custom Link View Model

class CreateCustomLinkViewModel(snackbarHostState: SnackbarHostState) : CreateItemViewModel<CustomRefyLink>

The CreateCustomLinkViewModel class is the support class used by CreateCustomLinkActivity to communicate with the backend for the creation or the editing of a CustomRefyLink

Author

N7ghtm4r3 - Tecknobit

Parameters

snackbarHostState

: the host to launch the snackbar messages

See also

ViewModel
FetcherManager.FetcherManagerWrapper
EquinoxViewModel

Constructors

Link copied to clipboard
constructor(snackbarHostState: SnackbarHostState)

Properties

Link copied to clipboard
lateinit var expiredTime: MutableState<CustomRefyLink.ExpiredTime>

expiredTime -> the expiration time chosen for the custom link

Link copied to clipboard
lateinit var fieldsSupportList: SnapshotStateList<Pair<String, String>>

fieldsSupportList -> the support list for the fields used to manage the UI's workflow

Link copied to clipboard
val itemDedicatedList: SnapshotStateList<String>

itemDedicatedList -> a dedicated list of the item, useful to manage for example links, collections or members list attached to the item

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

itemDescription -> the description of the item

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

itemDescriptionError -> whether the itemDescription field is not valid

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

itemName -> the name of the item

Link copied to clipboard
lateinit var resourcesSupportList: SnapshotStateList<Pair<String, String>>

resourcesSupportList -> the support list for the resources used to manage the UI's workflow

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun addItem(supportList: SnapshotStateList<Pair<String, String>>, index: Int, key: String, value: String)

Function to add an item to the support list, this process to keep refreshed the item (so when the user typing the characters sequence of the key for example), remove the current one and replace at the same index the new item

Link copied to clipboard
fun addNewItem(supportList: SnapshotStateList<Pair<String, String>>)

Function to add a new resource to a support list

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 initExistingItem(item: CustomRefyLink?)

Function to initializing the existingItem if exists, null otherwise

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

Wrapper function to execute the request to create or edit an item

Link copied to clipboard
fun removeItem(supportList: SnapshotStateList<Pair<String, String>>, index: Int)

Function to remove an item from a support list

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>)