Area

Creates a new Area instance.

Author

Arnau Mora

Since

20210416

Parameters

objectId

The id of the object

displayName

The Area's display name

timestampMillis

The update date of the Area

imagePath

The path of the Area's image on the server.

kmzPath

The path of the Area's KMZ file on the server. May be null if not applicable or non-existing.

webUrl

The url for the Area on the website

Constructors

Link copied to clipboard
fun Area(data: JSONObject, objectId: String, childrenCount: Long)

Creates a new Area from the data from the Data module. Note: This doesn't add children

Types

Link copied to clipboard

Functions

Link copied to clipboard
open override fun data(): AreaData

Converts the DataClass into a Search Data class.

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
open override fun displayMap(): Map<String, Serializable?>

Returns a map used to display the stored data to the user. Keys should be the parameter name, and the value the value to display. Should be overridden by target class.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Checks if the DataClass is the same as another one.

Link copied to clipboard
suspend fun get(context: Context, index: Int): Zone

Gets the children element at index. May throw IndexOutOfBoundsException if children have not been loaded.

suspend fun get(context: Context, objectId: String): Zone?

Finds an DataClass inside a list with an specific id. If it's not found, null is returned.

Link copied to clipboard
inline suspend fun <R : Comparable<R>> getChildren(context: Context, crossinline sortBy: (Zone) -> R?): List<Zone>

Returns the children of the DataClass.

Link copied to clipboard
suspend fun getCount(context: Context): Int

Returns the amount of children the DataClass has.

Link copied to clipboard
suspend fun <D : DataClass<*, *, *>> getParent(context: Context): D?

Gets the parent element of the DataClass.

Link copied to clipboard
suspend fun getSize(context: Context): Int

Returns the amount of children the DataClass has.

Link copied to clipboard
suspend fun has(context: Context, objectId: String): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

Checks if the DataClass has a stored downloadUrl.

Link copied to clipboard
fun Image(modifier: Modifier = Modifier, imageLoadParameters: ImageLoadParameters? = null, isPlaceholder: Boolean = false, onFinishLoading: () -> Unit)
Link copied to clipboard
fun imageFile(context: Context): File?

Returns the File that represents the image of the DataClass

Link copied to clipboard
suspend fun isEmpty(context: Context): Boolean

Checks if the data class has children. Note: won't load children, will just use the already loaded ones.

Link copied to clipboard
suspend fun isNotEmpty(context: Context): Boolean

Checks if the data class doesn't have any children

Link copied to clipboard
suspend fun kmzFile(context: Context, permanent: Boolean): File

Gets the KMZ file path. If it has never been loaded, it gets loaded from the server. Otherwise, it gets loaded from cache.

Link copied to clipboard
open override fun toString(): String

Converts the DataClass to a String for showing in debug or to the user. The string contains the first letter of the namespace, followed by a slash (/) and the objectId.

Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)

Properties

Link copied to clipboard
open override val displayName: String
Link copied to clipboard

Options for displaying in the UI.

Link copied to clipboard

The download url from Firebase Storage for the DataClass' image.

Link copied to clipboard
open override val hasParents: Boolean = false

Tells whether or not the DataClass has parent elements, or if it's root. Used in functions such as getParent to be quicker.

Link copied to clipboard
open override val imagePath: String
Link copied to clipboard
open override val kmzPath: String?
Link copied to clipboard
open val location: GeoPoint?

The coordinates of the DataClass to show in a map.

Link copied to clipboard

Some metadata of the DataClass.

Link copied to clipboard
Link copied to clipboard
open override val objectId: String
Link copied to clipboard
val pin: String

Provides a generic name for the DataClass.

Link copied to clipboard
Link copied to clipboard
open override val timestampMillis: Long
Link copied to clipboard