Custom Links View Model

class CustomLinksViewModel : LinksViewModel<CustomRefyLink>

The CustomLinksViewModel class is the support class used by CustomLinksScreen to communicate with the backend and to execute the refreshing routines to update the UI data and working with the RefyLink

Author

N7ghtm4r3 - Tecknobit

See also

ViewModel
FetcherManagerWrapper
EquinoxViewModel

Constructors

Link copied to clipboard
constructor()

Properties

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

linkDescription -> the description of the link

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

linkDescriptionError -> whether the linkDescription field is not valid

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

linkReference -> the url reference to of the link

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

linkReferenceError -> whether the linkReference field is not valid

Link copied to clipboard
lateinit var links: StateFlow<List<CustomRefyLink>>

Functions

Link copied to clipboard
open fun addCloseable(closeable: AutoCloseable)
fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
open override fun addLinkToCollections(link: CustomRefyLink, collections: List<String>, onSuccess: () -> Unit)

Function to share the link with collections

Link copied to clipboard
open override fun addLinkToTeams(link: CustomRefyLink, teams: List<String>, onSuccess: () -> Unit)

Function to share the link with teams

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 deleteLink(link: CustomRefyLink, onSuccess: () -> Unit)

Function to execute the request to delete a link

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

Function to execute the request to get the links list

Link copied to clipboard
fun manageLink(link: CustomRefyLink? = null, onSuccess: () -> Unit)

Wrapper function to execute the request to create or edit a link

Link copied to clipboard
open override fun restartRefresher()
Link copied to clipboard
open fun setActiveContext(currentContext: Class<*>)
Link copied to clipboard
fun setCurrentUserOwnedCollections(forceRefresh: Boolean = false)

Function to execute the request to fetch only the collections owned by the localUser, the collections fetched will be set to localUser.collections

Link copied to clipboard
fun setCurrentUserOwnedLinks(forceRefresh: Boolean = false)

Function to execute the request to fetch only the links owned by the localUser, the links fetched will be set to localUser.links

Link copied to clipboard
fun setCurrentUserOwnedTeams(forceRefresh: Boolean = false)

Function to execute the request to fetch only the teams owned by the localUser, the teams fetched will be set to localUser.teams

Link copied to clipboard
open override fun suspendRefresher()
Link copied to clipboard
fun SuspendUntilElementOnScreen(elementVisible: MutableState<Boolean>)