Package-level declarations

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the StatusBarHeight in Pixels

Link copied to clipboard
@get:RequiresApi(value = 28)
val View.hasNotch: Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns the Activity's content (root) view.

Link copied to clipboard
@set:RequiresPermission(value = "android.permission.WRITE_SETTINGS")
var Context.sleepDuration: Int

Functions

Link copied to clipboard
Link copied to clipboard

Simplify using AlertDialog

Link copied to clipboard
Link copied to clipboard
fun Activity.brightness(brightness: Float = 1.0f)

Sets the screen brightness. Call this before setContentView. 0 is dimmest, 1 is brightest. Default value is 1

Link copied to clipboard
Link copied to clipboard
inline fun <T> Activity.createShortcut(title: String, @DrawableRes icon: Int)

Creates shortcut launcher for pre/post oreo devices

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Makes the activity enter fullscreen mode.

Link copied to clipboard

Makes the Activity exit fullscreen mode.

Link copied to clipboard
fun <T> Activity.extra(key: String): Lazy<T?>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns display density as ...DPI

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Hide keyboard for an activity.

Link copied to clipboard

This snippet hides the system bars.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun <T : Any> Context.launchActivity(options: Bundle? = null, noinline init: Intent.() -> Unit = {})
inline fun <T : Any> Activity.launchActivity(requestCode: Int = -1, options: Bundle? = null, noinline init: Intent.() -> Unit = {})
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
operator fun Window.minusAssign(flags: Int)
Link copied to clipboard
inline fun <T : Any> newIntent(context: Context): Intent
Link copied to clipboard
Link copied to clipboard
operator fun Window.plusAssign(flags: Int)
Link copied to clipboard

Iterate through fragments attached to FragmentManager and pop's one after the other.

Link copied to clipboard

An extension to postponeEnterTransition which will resume after a timeout.

Link copied to clipboard
inline fun Activity.restart(intentBuilder: Intent.() -> Unit = {})

Restarts an activity from itself with a fade animation Keeps its existing extra bundles and has a intentBuilder to accept other parameters

Link copied to clipboard

Force restart an entire application

Link copied to clipboard
fun Activity.screenShot(removeStatusBar: Boolean = false): Bitmap?
@RequiresApi(value = 26)
fun Activity.screenShot(removeStatusBar: Boolean = false, listener: (Int, Bitmap) -> Unit)
Link copied to clipboard
Link copied to clipboard

Set Navigation Bar Color

Link copied to clipboard

Set Navigation Bar Divider Color if Build.VERSION.SDK_INT >= Build.VERSION_CODES.P

Link copied to clipboard

Set Status Bar Color

Link copied to clipboard

Set the action bar title

Link copied to clipboard
fun AppCompatActivity.setupToolbar(toolbar: Toolbar, displayHomeAsUpEnabled: Boolean = true, displayShowHomeEnabled: Boolean = true, displayShowTitleEnabled: Boolean = false, showUpArrowAsCloseIcon: Boolean = false, @DrawableRes closeIconDrawableRes: Int? = null)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Activity.showKeyboard(toFocus: View)

Show keyboard for an activity.

Link copied to clipboard

This snippet shows the system bars. It does this by removing all the flags except for the ones that make the content appear under the system bars.

Link copied to clipboard
Link copied to clipboard
inline fun <T> Activity.startActivityForResult(requestCode: Int, bundleBuilder: Bundle.() -> Unit = {}, intentBuilder: Intent.() -> Unit = {})