ViewUtils

object ViewUtils

Properties

Link copied to clipboard

Convenient property to get and set bottom padding

Link copied to clipboard
val CheckedSetting.checkbox: CompoundButton

Checkbox button at the end of the setting

Link copied to clipboard

Convenient property to get and set end padding (right on ltr, left on rtl)

Link copied to clipboard
val CheckedSetting.label: TextView

Main text/label of the setting

Link copied to clipboard
val CheckedSetting.layout: ConstraintLayout

Main layout of the setting

Link copied to clipboard

Convenient property to get and set left padding

Link copied to clipboard

Convenient property to get and set a Padding value

Link copied to clipboard

Convenient property to get and set right padding

Link copied to clipboard

Convenient property to get and set start padding (left on ltr, right on rtl)

Link copied to clipboard
val CheckedSetting.subtext: TextView

Subtext of the setting

Link copied to clipboard

Convenient property to get and set top padding

Functions

Link copied to clipboard
inline fun <T : View> T.addTo(group: ViewGroup, block: T.() -> Unit = {}): T

Shorthand extension function to add a View into a ViewGroup, and then run a scoped function

inline fun <T : View> T.addTo(group: ViewGroup, index: Int, block: T.() -> Unit = {}): T

Shorthand extension function to add a View into a ViewGroup at specified index, and then run a scoped function

Link copied to clipboard
fun <T : View?> View.findViewById(idName: String): T

The same as View.findViewById, but takes the name of the id instead.

Link copied to clipboard
fun <T : View> T.setDefaultMargins(bottom: Boolean = true, top: Boolean = false, left: Boolean = true, right: Boolean = true): T

Adds default discord paddings as margins to a View. By default, margins are set for the bottom, left, and right of the View, but not the top.

Link copied to clipboard
fun View.setPadding(value: Int)

Set a uniform padding for all sides