Package com.aliucord.utils
Object ViewUtils
-
- All Implemented Interfaces:
public class ViewUtils
-
-
Field Summary
Fields Modifier and Type Field Description private final ConstraintLayout
layout
private final TextView
label
private final CompoundButton
checkbox
private final TextView
subtext
public final static ViewUtils
INSTANCE
-
Method Summary
Modifier and Type Method Description final <T extends View> T
addTo(T $self, ViewGroup group, Function1<T, Unit> block)
Shorthand extension function to add a View into a ViewGroup, and then run a scoped function final <T extends View> T
addTo(T $self, ViewGroup group, Integer index, Function1<T, Unit> block)
Shorthand extension function to add a View into a ViewGroup at specified index, and then run a scoped function final <T extends View> T
setDefaultMargins(T $self, Boolean bottom, Boolean top, Boolean left, Boolean right)
Adds default discord paddings as margins to a View. final ConstraintLayout
getLayout(CheckedSetting $self)
final TextView
getLabel(CheckedSetting $self)
final CompoundButton
getCheckbox(CheckedSetting $self)
final TextView
getSubtext(CheckedSetting $self)
-
-
Method Detail
-
addTo
final <T extends View> T addTo(T $self, ViewGroup group, Function1<T, Unit> block)
Shorthand extension function to add a View into a ViewGroup, and then run a scoped function
- Parameters:
group
- ViewGroup to add this View intoblock
- A scoped function, with the View as its receiver
-
addTo
final <T extends View> T addTo(T $self, ViewGroup group, Integer index, Function1<T, Unit> block)
Shorthand extension function to add a View into a ViewGroup at specified index, and then run a scoped function
- Parameters:
group
- ViewGroup to add this View intoindex
- Index to insert this View atblock
- A scoped function, with the View as its receiver
-
setDefaultMargins
final <T extends View> T setDefaultMargins(T $self, Boolean bottom, Boolean top, Boolean left, Boolean right)
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.
- Parameters:
bottom
- Whether to set topMargin.top
- Whether to set bottomMargin.left
- Whether to set leftMargin.right
- Whether to set rightMargin.
-
getLayout
final ConstraintLayout getLayout(CheckedSetting $self)
-
getCheckbox
final CompoundButton getCheckbox(CheckedSetting $self)
-
getSubtext
final TextView getSubtext(CheckedSetting $self)
-
-
-
-