DefaultDirectoryObjectViewModel

class DefaultDirectoryObjectViewModel(val directoryObject: DirectoryObject, onShowEntrances: (List<EntranceInfo>) -> Unit? = null, onHeaderHeightChanged: (Dp) -> Unit? = null, onMinimize: () -> Unit? = null, onMaximize: () -> Unit? = null, onClose: () -> Unit? = null, lastLocation: GeoPoint?) : DirectoryObjectViewModel

Default implementation of the DirectoryObjectViewModel interface.

This ViewModel provides the standard business logic for a directory object detail screen, transforming raw DirectoryObject data into UI-ready view-model. It handles formatting of addresses, distance calculations, etc.

Parameters

directoryObject

The source directory object containing all raw data.

onShowEntrances

Optional callback triggered when user requests to view detailed entrance information.

onHeaderHeightChanged

Optional callback function triggered when the height of the header component changes.

onMinimize

Optional callback triggered when the user requests to collapse the detail view.

onMaximize

Optional callback triggered when the user requests to expand the detail view.

onClose

Optional callback triggered when user requests to close/dismiss the detail view. Used for closing bottom sheets/dialogs.

lastLocation

The user's last known geo-coordinates, used for: - Calculating and formatting distance to the object - Determining relative location context If null, distance-related properties will be null/unavailable.

Constructors

Link copied to clipboard
constructor(directoryObject: DirectoryObject, onShowEntrances: (List<EntranceInfo>) -> Unit? = null, onHeaderHeightChanged: (Dp) -> Unit? = null, onMinimize: () -> Unit? = null, onMaximize: () -> Unit? = null, onClose: () -> Unit? = null, lastLocation: GeoPoint?)

Properties

Link copied to clipboard
open override val canShowEntrances: Boolean

Indicates whether entrance or porch information is available and can be displayed.

Link copied to clipboard
open override val contacts: List<ContactData>

List of ContactData items available for this directory object.

Link copied to clipboard
open override val directoryObject: DirectoryObject
Link copied to clipboard
open override val distance: Meter?

Distance to the object. Null if distance is unavailable.

Link copied to clipboard
open override val entrancesType: EntranceType?

The type of entrances available for this directory object. Determines how entrance information should be displayed and what options are available.

Link copied to clipboard
open override val floorsInfo: FloorsInfo?

Information about floors of this directory object.

Link copied to clipboard
open override val fullAddressMainLine: String?

Primary/main line of the full address.

Link copied to clipboard
open override val fullAddressSecondaryLine: String?

Secondary line of the full address with additional location details.

Link copied to clipboard
open override val openingHours: OpeningHours?

The regular weekly schedule defining operating hours.

Link copied to clipboard
open override val porches: List<PorchItem>

List of PorchItem items available for this directory object.

Link copied to clipboard
open override val rating: Float?

Average user rating from 0 to 5 (e.g., 4.2). Null if not rated.

Link copied to clipboard
open override val reviewsCount: Int

Total number of reviews submitted for this object.

Link copied to clipboard
open override val shortAddress: String?

Short address suitable for list items and compact displays.

Link copied to clipboard
open override val subtitle: String

Subtitle or short description of the object.

Link copied to clipboard
open override val title: String

The main title or name of the directory object.

Link copied to clipboard
open override val titleAddition: String

Additional descriptive text that complements the main title.

Link copied to clipboard
open override val workStatus: WorkStatus?

The current operational status of the entity.

Functions

Link copied to clipboard
open override fun closeView()

Closes the current view, dismissing the bottom sheet, dialog, or detail screen entirely.

Link copied to clipboard
open override fun maximizeView()

Maximizes the current view, typically expanding a bottom sheet or modal to a increase state.

Link copied to clipboard
open override fun minimizeView()

Minimizes the current view, typically collapsing a bottom sheet or modal to a reduced state.

Link copied to clipboard
open override fun setHeaderHeight(newHeight: Dp)

Updates the current height of the header component.

Link copied to clipboard
open override fun showEntrances()

Displays the detailed entrances/porches selection UI.