GroupsScreenViewModel

The GroupsScreenViewModel is useful to manage the lists displayed in the com.tecknobit.pandoro.ui.screens.groups.presenter.GroupsScreen

Author

N7ghtm4r3 - Tecknobit

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val allGroupsState: PaginationState<Int, Group>

allGroupsState the state used to manage the pagination for the retrieveAllGroups method

Link copied to clipboard

allGroupsStateFilters the filters to apply to the allGroupsState list

Link copied to clipboard
val myGroupsState: PaginationState<Int, Group>

myGroupsState the state used to manage the pagination for the retrieveMyGroups method

Link copied to clipboard

myGroupsStateFilters the filters to apply to the myGroupsState list

Link copied to clipboard
open override val requestsScope: CoroutineScope

requestsScope coroutine used to send the requests to the backend

Link copied to clipboard

roleFilters the roles used as filters to apply to the allGroupsState list

Link copied to clipboard
lateinit var sessionFlowState: SessionFlowState

sessionFlowState the state used to manage the session lifecycle in the screen

Link copied to clipboard

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
open override fun areFiltersSet(allItems: Boolean): Boolean

Method to check whether the filters have been set

Link copied to clipboard
open override fun canRetrieverStart(): Boolean
Link copied to clipboard
open override fun clearFilters(allItems: Boolean)

Method to clear filters have been set

Link copied to clipboard
open override fun continueToRetrieve(currentContext: KClass<*>): Boolean
Link copied to clipboard
open fun deleteGroup(group: Group, onDelete: () -> Unit, onFailure: (JsonObject) -> Unit)

Method to delete a group

Link copied to clipboard
open override fun filterItems(allItems: Boolean, filters: MutableState<String>, onFiltersSet: () -> Unit)

Method to filter the items list

Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun manageRoleFilter(role: Role)

Method to manage the roleFilters list

Link copied to clipboard

Method to refresh the myGroupsState and the allGroupsState after a group deleted

Link copied to clipboard

Method to reset as default the roleFilters list

Link copied to clipboard
open override fun restartRetriever()
Link copied to clipboard
open fun restartRetrieverIf(condition: Boolean)
Link copied to clipboard
open override fun retrieve(currentContext: KClass<*>, routine: suspend () -> Unit, repeatRoutine: Boolean, refreshDelay: Long)
Link copied to clipboard
open override fun retryRetrieveLists()

Method to retry the retrieving of the lists data

Link copied to clipboard
open fun setActiveContext(currentContext: KClass<*>)
Link copied to clipboard
fun showSnackbarMessage(message: String, actionLabel: String?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
fun showSnackbarMessage(response: JsonObject, actionLabel: String?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
fun showSnackbarMessage(message: StringResource, actionLabel: StringResource?, onDismiss: () -> Unit?, onActionPerformed: () -> Unit?, withDismissAction: Boolean, duration: SnackbarDuration)
Link copied to clipboard
open override fun suspendRetriever()
Link copied to clipboard
open fun suspendRetrieverIf(condition: Boolean)