Package-level declarations

Types

Link copied to clipboard
class CustomRecentEmojiProvider(customEmojiFrequency: String?, onUpdateCustomEmojiFrequency: (updatedValue: String) -> Unit) : RecentEmojiAsyncProvider

Define a custom recent emoji provider which shows most frequently used emoji

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
object GPSFormat
Link copied to clipboard
object GraphUtil
Link copied to clipboard
Link copied to clipboard
class SqlTileWriterExt : SqlTileWriter

Extended the sqlite tile writer to have some additional query functions. A this point it's unclear if there is a need to put these with the osmdroid-android library, thus they were put here as more of an example.

Link copied to clipboard
sealed class UiText
Link copied to clipboard
Link copied to clipboard
This filter will constrain edits so that the text length is not greater than the specified number of bytes using UTF-8 encoding.

Properties

Link copied to clipboard

When printing strings to logs sometimes we want to print useful debugging information about users or positions. But we don't want to leak things like usernames or locations. So this function if given a string, will return a string which is a maximum of three characters long, taken from the tail of the string. Which should effectively hide real usernames and locations, but still let us see if values were zero, empty or different.

Functions

Link copied to clipboard
fun MapView.addCopyright()

Adds copyright to map depending on what source is showing

Link copied to clipboard
fun MapView.addPolyline(density: Density, geoPoints: List<GeoPoint>, onClick: () -> Unit): Polyline
Link copied to clipboard
fun MapView.addPositionMarkers(positions: List<<Error class: unknown class>>, onClick: () -> Unit): List<Marker>
Link copied to clipboard
fun MapView.addScaleBarOverlay(density: Density)
Link copied to clipboard
fun Any?.anonymize(maxLen: Int = 3): String

A version of anonymize that allows passing in a custom minimum length

Link copied to clipboard
fun bearing(lat1: Double, lon1: Double, lat2: Double, lon2: Double): Double

Computes the bearing in degrees between two points on Earth.

Link copied to clipboard
fun MapView.createLatLongGrid(enabled: Boolean)

Create LatLong Grid line overlay

Link copied to clipboard
fun ByteString.encodeToString(): String
Link copied to clipboard
fun exceptionReporter(inner: () -> Unit)

This wraps (and discards) exceptions, but first it reports them to our bug tracking system and prints a message to the log.

Link copied to clipboard
fun exceptionToSnackbar(view: View, inner: () -> Unit)

If an exception occurs, show the message in a snackbar and continue

Link copied to clipboard
fun formatAgo(lastSeenUnix: Int, currentTimeMillis: Long = System.currentTimeMillis()): String
Link copied to clipboard
fun formatUptime(seconds: Int): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getShortDate(time: Long): String?
Link copied to clipboard
Link copied to clipboard
fun ignoreException(silent: Boolean = false, inner: () -> Unit)

This wraps (and discards) exceptions, but it does output a log message

Link copied to clipboard
fun <Error class: unknown class>.isKnown(): Boolean

Checks if the hardware model is a known/supported value.

Link copied to clipboard
fun latLongToMeter(latitudeA: Double, longitudeA: Double, latitudeB: Double, longitudeB: Double): Double
Link copied to clipboard
fun Int.metersIn(system: <Error class: unknown class>): Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun EditText.onEditorAction(actionId: Int, func: () -> Unit)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Context.registerReceiverCompat(receiver: BroadcastReceiver, filter: IntentFilter, flag: Int = ContextCompat.RECEIVER_EXPORTED)
Link copied to clipboard
fun BoundingBox.requiredZoomLevel(): Double

Calculates the zoom level required to fit the entire BoundingBox inside the map view.

Link copied to clipboard
fun <Error class: unknown class>.safeNumber(fallbackValue: Int = -1): Int

Safely extracts the hardware model number from a HardwareModel enum.

Link copied to clipboard
inline fun Modifier.thenIf(precondition: Boolean, action: Modifier.() -> Modifier): Modifier

Conditionally applies the action to the receiver Modifier, if precondition is true. Returns the receiver as-is otherwise.

Link copied to clipboard
fun String.toByteString(): ByteString
Link copied to clipboard
fun Int.toDistanceString(system: <Error class: unknown class>): String
Link copied to clipboard
fun ByteArray.toHexString(): <Error class: unknown class>
Link copied to clipboard
fun <Error class: unknown class>.toOneLineString(): String
fun <Error class: unknown class>.toOneLineString(): String
fun Any.toOneLineString(): <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
fun <T> toRemoteExceptions(inner: () -> T): T
Link copied to clipboard
fun Float.toSmallDistanceString(system: <Error class: unknown class>): String
Link copied to clipboard
fun Float.toSpeedString(system: <Error class: unknown class>): String
Link copied to clipboard
fun Float.toString(system: <Error class: unknown class>): String
Link copied to clipboard
fun BoundingBox.zoomIn(zoomFactor: Double): BoundingBox

Creates a new bounding box with adjusted dimensions based on the provided zoomFactor.