ViewUtils

object ViewUtils

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> 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.

Properties

Link copied to clipboard
val CheckedSetting.checkbox: CompoundButton

Checkbox button at the end of the setting

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
val CheckedSetting.subtext: TextView

Subtext of the setting