Package-level declarations

Properties

Link copied to clipboard

Extension property to get the NotificationManager system service.

Functions

Link copied to clipboard

Cancels a notification with the given ID.

Link copied to clipboard
@RequiresApi(value = 26)
fun NotificationManager.createChannel(channelId: String, channelName: String)

Creates a notification channel with the given ID and name.

Link copied to clipboard

Retrieves an instance of the specified Activity from the current Context.

Link copied to clipboard

Calculates the total size of a directory recursively, including all files and subdirectories.

Link copied to clipboard

Creates an Intent to launch an activity for installing an APK from the given uri.

Link copied to clipboard
fun Context.notificationBuilder(channelId: String, block: NotificationCompat.Builder.() -> Unit? = null, color: Int = Color.parseColor("#B39DDB")): NotificationCompat.Builder

Creates and returns a NotificationCompat.Builder with the given channel ID and optional configuration.

Link copied to clipboard

Shows multiple notifications at once.

fun Context.notify(id: Int, notification: Notification)

Shows a notification with the given ID and Notification object.

fun Context.notify(id: Int, channelId: String, channelName: String, shouldInitializeChannel: Boolean = false, block: NotificationCompat.Builder.() -> Unit? = null)

Creates and shows a notification with the given parameters.

Link copied to clipboard
fun BufferedSource.saveTo(file: File)

Saves the content of this BufferedSource to the specified file.

fun BufferedSource.saveTo(stream: OutputStream)

Saves the content of this BufferedSource to the specified OutputStream.

Link copied to clipboard
fun Context.showToast(message: String, duration: Int = Toast.LENGTH_SHORT)

Shows a toast message with the given message and duration.