UserLocations

Entity holding all personal locations of the current user of the application.

Important: This is a Public Preview API. It may be changed or removed at any time.

All modifications to the personal locations must be persisted using PersonalData.storeUserProfile.

This class ensures the uniqueness of PersonalLocationType.Home and PersonalLocationType.Work location types. When a new location is added or an existing location is updated to have one of these types, any existing location of the same type will have its type removed to maintain this uniqueness constraint. This behavior is implemented in the add, create, and update methods.

See also

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

All personal locations of the user.

Link copied to clipboard

The favorite locations of the user.

Link copied to clipboard

The user's home location.

Link copied to clipboard

The recent destinations of the user, ordered with the most recent one first.

Link copied to clipboard

The work location of the user.

Functions

Link copied to clipboard
fun add(types: Set<PersonalLocationType>, place: Place, name: String = "", hasPrivateCharger: Boolean = false): PersonalLocation

Adds the place as a personal location with the given types. If a personal location with the same name and place already exists, the existing personal location is updated with the new types and returned.

Link copied to clipboard
fun create(types: Set<PersonalLocationType>, place: Place, name: String = "", hasPrivateCharger: Boolean = false): PersonalLocation

Creates a new personal location with the given types.

Link copied to clipboard

Find a personal location by its identifier.

Link copied to clipboard

Checks whether this place is associated with any personal locations.

Link copied to clipboard

Find personal locations by the given place.

Link copied to clipboard

Removes the given personal location.

Link copied to clipboard

Updates the given personal location with the new types.