Package-level declarations

Types

Link copied to clipboard
enum Anchor : Enum<Anchor>
Link copied to clipboard
Link copied to clipboard
object I
Link copied to clipboard
class MultiplePartialConstraint(val views: Array<View>, val margin: Int)
Link copied to clipboard
Link copied to clipboard
class SideConstraint(val constant: Int)
Link copied to clipboard
class SinglePartialConstraint(val view: View, val margin: Int)
Link copied to clipboard
data class ViewDimensions(val left: Int = 0, val top: Int = 0, val right: Int = 0, val bottom: Int = 0, val start: Int = 0, val end: Int = 0)

Properties

Link copied to clipboard
Link copied to clipboard
val atMost: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
var Int.dp: Int
Link copied to clipboard

View artificial attribute that sets compound bottom drawable

Link copied to clipboard

View artificial attribute that sets compound left drawable

Link copied to clipboard

View artificial attribute that sets compound right drawable

Link copied to clipboard

View artificial attribute that sets compound top drawable

Link copied to clipboard

Allows you to modify the elevation on a view without worrying about version.

Link copied to clipboard
Link copied to clipboard

get Activity On Which View is inflated to

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

Returns the innermost focused child within this View hierarchy, or null if this is not a ViewGroup

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

Return true if navigation bar is at the bottom, false otherwise

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val matchConstraint: Int
Link copied to clipboard
const val matchParent: Int
Link copied to clipboard

Return true if navigation bar change its position when device rotates, false otherwise

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

Returns the default, clear background for selectable items without a border. Reacts when touched.

Link copied to clipboard

Returns the default, clear background for selectable items. Reacts when touched.

Link copied to clipboard

Return the status bar height. 0 otherwise

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
const val wrapContent: Int

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun TextView.addFadeOutToText(galleryHeight: Int, @ColorRes fromColor: Int, @ColorRes toColor: Int)
Link copied to clipboard
fun TabLayout.addMarginInTabLayout(color: Int, width: Int, height: Int, paddingFromDivider: Int)
Link copied to clipboard

Sets color to status bar

Link copied to clipboard
fun TabLayout.addTab(@StringRes title: Int, @DrawableRes icon: Int, @LayoutRes customView: Int)
Link copied to clipboard
fun adjustAlpha(@ColorInt color: Int, factor: Float): Int
Link copied to clipboard
fun View.afterLatestMeasured(callback: () -> Unit)
Link copied to clipboard
inline fun <T : View> T.afterMeasured(crossinline function: T.() -> Unit)

Extension method to remove the required boilerplate for running code after a view has been inflated and measured.

Link copied to clipboard
fun alignBottoms(vararg views: View)
Link copied to clipboard
fun alignHorizontally(vararg views: View)
Link copied to clipboard

Aligns in the center of the parent in relative layout

Link copied to clipboard
fun alignLefts(vararg views: View)
Link copied to clipboard

Aligns to right of the parent in relative layout

Link copied to clipboard

Aligns to left of the parent in relative layout

Link copied to clipboard
fun alignRights(vararg views: View)
Link copied to clipboard
fun alignTops(vararg views: View)
Link copied to clipboard
fun alignVertically(vararg views: View)
Link copied to clipboard
fun View.alphaAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard
infix fun View.and(v: View): List<View>
infix fun List<View>.and(v: View): List<View>
Link copied to clipboard
fun View.animateAlpha(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateHeight(targetValue: Int, duration: Long = 400, action: (Float) -> Unit? = null)
Link copied to clipboard
fun View.animateRotation(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateRotationX(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateRotationY(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateScaleX(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateScaleY(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateTranslationX(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateTranslationY(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateTranslationZ(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateWidth(targetValue: Int, duration: Long = 400, action: (Float) -> Unit? = null)
Link copied to clipboard
fun View.animateWidthAndHeight(targetWidth: Int, targetHeight: Int, duration: Long = 400, action: (Float) -> Unit? = null)
Link copied to clipboard
fun View.animateX(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateY(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard
fun View.animateZ(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0)
Link copied to clipboard

Get bitmap representation of view

Link copied to clipboard
fun View.aspect(ratio: Float = 3 / 4f): Boolean
Link copied to clipboard
Link copied to clipboard
fun View.blink(duration: Long = 300)
Link copied to clipboard
fun View.bool(@BoolRes resourceId: Int): Boolean
Link copied to clipboard
fun <T : View> T.bottom(margin: Int): T
Link copied to clipboard

Sets bottom margin for views in Linear Layout

Link copied to clipboard
fun View.bottomMargin(size: Int)

Sets bottom margin for views

Link copied to clipboard

Sets bottom margin for views in Relative Layout

Link copied to clipboard
Link copied to clipboard
fun <T : View> T.centerInParent(): T
Link copied to clipboard
Link copied to clipboard
fun View.changeBackgroundColor(@ColorInt newColor: Int, duration: Int = 300)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

get All the Children's as Iterator

Link copied to clipboard
fun Int.clamp(min: Int, max: Int): Int

Restricts Int to be within a min and a max value

Link copied to clipboard
Link copied to clipboard
fun TextView.clickify(clickableText: String, listener: View.OnClickListener)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun View.collapseIf(value: Boolean)

Sets receiver's visibility to View.GONE if value is true; sets it to View.VISIBLE otherwise. Opposite of expandIf; also see hideIf.

Link copied to clipboard

Sets receiver's visibility to View.GONE if TextView.getText is null or empty; sets it to View.VISIBLE otherwise.

Link copied to clipboard
fun collapseLayout(linearLayout: LinearLayout, imageView: ImageView, dropUPIMG: Int, dropDOWNIMG: Int)
Link copied to clipboard
fun View.color(resourceId: Int): Int
Link copied to clipboard
Link copied to clipboard
fun View.colorWithAlpha(@ColorRes res: Int, @IntRange(from = 0, to = 100) alphaPercent: Int): Int

Get color from resources with alpha

Link copied to clipboard
fun View.colorWithOpacity(@ColorRes res: Int, @IntRange(from = 0, to = 100) opacity: Int): Int

Get color from resources with applied opacity

Link copied to clipboard
fun <T : View> T.constrainBottomToBottomOf(view: View, margin: Int = 0): T
fun <T : View> T.constrainBottomToBottomOf(viewId: Int, margin: Int = 0): T
Link copied to clipboard
fun <T : View> T.constrainBottomToTopOf(view: View, margin: Int = 0): T
fun <T : View> T.constrainBottomToTopOf(viewId: Int, margin: Int = 0): T
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
fun <T : View> T.constrainLeftToLeftOf(view: View, margin: Int = 0): T
fun <T : View> T.constrainLeftToLeftOf(viewId: Int, margin: Int = 0): T
Link copied to clipboard
fun <T : View> T.constrainLeftToRightOf(view: View, margin: Int = 0): T
fun <T : View> T.constrainLeftToRightOf(viewId: Int, margin: Int = 0): T
Link copied to clipboard
fun <T : View> T.constrainRightToLeftOf(view: View, margin: Int = 0): T
fun <T : View> T.constrainRightToLeftOf(viewId: Int, margin: Int = 0): T
Link copied to clipboard
fun <T : View> T.constrainRightToRightOf(view: View, margin: Int = 0): T
fun <T : View> T.constrainRightToRightOf(viewId: Int, margin: Int = 0): T
Link copied to clipboard
fun <T : View> T.constrainTopToBottomOf(view: View, margin: Int = 0): T
fun <T : View> T.constrainTopToBottomOf(viewId: Int, margin: Int = 0): T
Link copied to clipboard
fun <T : View> T.constrainTopToTopOf(view: View, margin: Int = 0): T
fun <T : View> T.constrainTopToTopOf(viewId: Int, margin: Int = 0): T
Link copied to clipboard
inline fun DrawerLayout.consume(gravity: Int = GravityCompat.START, func: () -> Unit): Boolean
Link copied to clipboard

Function which updates the given rect with this view's position and bounds in its window.

Link copied to clipboard
fun AutoCompleteTextView.create(@LayoutRes itemLayout: Int, @IdRes textViewId: Int, items: Array<String>, onItemSelected: (String, Int) -> Unit = { _, _ -> })
fun AutoCompleteTextView.create(@LayoutRes itemLayout: Int, @IdRes textViewId: Int, items: MutableList<String>, onItemSelected: (String, Int) -> Unit = { _, _ -> })
fun Spinner.create(@LayoutRes itemLayout: Int, @IdRes textViewId: Int, items: Array<String>, onItemSelected: (String, Int) -> Unit = { _, _ -> })
fun Spinner.create(@LayoutRes itemLayout: Int, @IdRes textViewId: Int, items: MutableList<String>, onItemSelected: (String, Int) -> Unit = { _, _ -> })
Link copied to clipboard
fun View.createCircularReveal(revealDuration: Long = 1500, centerX: Int = 0, centerY: Int = 0, @ColorRes startColor: Int, @ColorRes endColor: Int, showAtEnd: Boolean = true): Animator
Link copied to clipboard
fun View.dimen(@DimenRes resourceId: Int): Float
Link copied to clipboard
fun View.dip(value: Int): Int
Link copied to clipboard
fun dip2px(context: Context, dpValue: Float): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun AppBarLayout.disableDragging()
Link copied to clipboard
fun View.disableIf(boolean: Boolean): () -> Unit

will disable the view If Condition is true else enables It

Link copied to clipboard

AndroidX version of searchview gets the disabled icon hint

Link copied to clipboard
Link copied to clipboard
fun View.doOnApplyWindowInsets(f: (View, insets: WindowInsetsCompat, initialPadding: ViewDimensions, initialMargin: ViewDimensions) -> Unit)
Link copied to clipboard
inline fun TabLayout.doOnTabReselected(crossinline action: (TabLayout.Tab) -> Unit)
Link copied to clipboard
inline fun TabLayout.doOnTabSelected(crossinline action: (TabLayout.Tab) -> Unit)
Link copied to clipboard
inline fun TabLayout.doOnTabUnSelected(crossinline action: (TabLayout.Tab) -> Unit)
Link copied to clipboard
fun Context.dpToPx(value: Int): Float
fun Number.dpToPx(context: Context? = null): Float
Link copied to clipboard
fun View.drawable(@DrawableRes resourceId: Int): Drawable?
fun View.drawable(@DrawableRes resourceId: Int, tintColorResId: Int): Drawable?
Link copied to clipboard
inline fun ViewGroup.eachChild(func: (view: View) -> Unit)

Applys given func to all child views

Link copied to clipboard
fun View.elevate(elevation: Float)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun View.enableIf(boolean: Boolean): () -> Unit

will enable the view If Condition is true else enables It

Link copied to clipboard

Sets right margin for views in Linear Layout

Link copied to clipboard
fun View.endMargin(size: Int)

Sets right margin for views

Link copied to clipboard

Sets right margin for views in Relative Layout

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T : View> T.fillHorizontally(padding: Int = 0): T
Link copied to clipboard
fun <T : View> T.fillParent(padding: Int = 0): T
Link copied to clipboard
fun <T : View> T.fillVertically(padding: Int = 0): T
Link copied to clipboard
inline fun Menu.filter(action: (item: MenuItem) -> Boolean): List<MenuItem>

Performs the given action on each item in this menu.

Link copied to clipboard
inline fun <T : ViewParent> View.findParentOfType(): T?
Link copied to clipboard
inline fun <T : View> ViewGroup.findView(): T?
Link copied to clipboard
fun <T : View> T.followEdgesOf(view: View, margin: Int = 0): T
Link copied to clipboard
Link copied to clipboard
inline fun TabLayout.forEach(func: (TabLayout.Tab) -> Unit)
Link copied to clipboard

Request to be laid out fullscreen tell the system to lay out our app behind the system bars

Link copied to clipboard
operator fun ViewGroup.get(i: Int): View?

Gets Child View at index

operator fun TabLayout.get(position: Int): TabLayout.Tab
Link copied to clipboard

get Activity On Which View is inflated to

Link copied to clipboard
Link copied to clipboard

View as bitmap.

Link copied to clipboard
fun ViewGroup.getBottomLevelChildren(stopAtRecyclerView: Boolean = false): List<View>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun View.getCurrentColor(@ColorInt default: Int = Color.TRANSPARENT): Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun View.getGoneHeight(callback: (futureHeight: Int) -> Unit)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getLocationOnScreen(textView: View): Rect
Link copied to clipboard
Link copied to clipboard
fun Context.getScaledDrawable(@DrawableRes resourceId: Int, scaleInDp: Int): Drawable
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun TabLayout.getTabViewAt(position: Int): View
Link copied to clipboard

Get views by tag for ViewGroup.

Link copied to clipboard
fun View.gone()
fun Array<View>.gone()
fun List<View>.gone()
Link copied to clipboard
inline fun View.goneIf(block: () -> Boolean)

Gone if condition met

Link copied to clipboard
inline fun View.goneIfElseVisible(block: () -> Boolean)

Gone if condition met

Link copied to clipboard
Link copied to clipboard
fun View.gradient(radius: Float, vararg colors: Int)

gradient(200f, 0x80C24641.toInt(), 0x80FFFFFF.toInt())

Link copied to clipboard
fun <T : View> T.height(value: Float): T
fun <T : View> T.height(value: Int): T
Link copied to clipboard

Hides all child views

Link copied to clipboard
fun View.hideIf(value: Boolean)

Sets receiver's visibility to View.INVISIBLE if value is true; sets it to View.VISIBLE otherwise. Opposite of showIf; also see collapseIf.

Link copied to clipboard

Sets receiver's visibility to View.INVISIBLE if TextView.getText is null or empty; sets it to View.VISIBLE otherwise.

Link copied to clipboard
Link copied to clipboard
fun PopupMenu.hideItem(@IdRes res: Int, hide: Boolean = true)
fun PopupMenu.hideItem(@IdRes res: Int, hide: Boolean = true)
Link copied to clipboard
fun FloatingActionButton.hideOnDownwardsScroll(recycler: RecyclerView)

Attaches a listener to the recyclerview to hide the fab when it is scrolling downwards The fab will reappear when scrolling has stopped or if the user scrolls up

Link copied to clipboard
fun hideOnLostFocus(event: MotionEvent, vararg views: View)
Link copied to clipboard

Hides the soft input for the vindow.

Link copied to clipboard
fun TabLayout.hideTitles()
Link copied to clipboard
fun hideViews(vararg views: View)

Hides all the views passed in the arguments

Link copied to clipboard
fun Context.hideViews(vararg views: View)

Hides all the views passed as argument(s)

Link copied to clipboard
fun horizontalLayout(vararg items: Any): Array<out Any>
Link copied to clipboard
inline fun View.ifGone(action: () -> Unit)
Link copied to clipboard
inline fun View.ifInvisible(action: () -> Unit)
Link copied to clipboard
inline fun View.ifVisible(action: () -> Unit)
Link copied to clipboard
fun ViewGroup.inflate(layoutRes: Int): View

USAGE

Link copied to clipboard
fun insertPeriodically(text: String, insert: String, period: Int): String
Link copied to clipboard
fun View.integer(@IntegerRes resourceId: Int): Int
Link copied to clipboard
fun AppBarLayout.invalidateScrollRanges()
Link copied to clipboard
Link copied to clipboard
inline fun View.invisibleIf(block: () -> Boolean)

Invisible if condition met

Link copied to clipboard
inline fun View.invisibleIfElseVisible(block: () -> Boolean)

Invisible if condition met

Link copied to clipboard
Link copied to clipboard
fun View.isInBounds(container: View): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun layout(vararg items: Any)
Link copied to clipboard
fun <T : View> T.left(margin: Int): T
Link copied to clipboard
fun View.limitHeight(h: Int, min: Int, max: Int): View
Link copied to clipboard
fun View.limitWidth(w: Int, min: Int, max: Int): View
Link copied to clipboard
fun View.linearMargins(left: Int, top: Int, right: Int, bottom: Int)

Sets margins for views in Linear Layout

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun View.margins(leftMargin: Int = Int.MAX_VALUE, topMargin: Int = Int.MAX_VALUE, rightMargin: Int = Int.MAX_VALUE, bottomMargin: Int = Int.MAX_VALUE): View
Link copied to clipboard
inline fun Snackbar.maxLines(lines: Int): Snackbar
Link copied to clipboard
operator fun View.minus(view: View): Array<View>
operator fun View.minus(side: I): View
operator fun View.minus(margin: Int): SinglePartialConstraint
operator fun I.minus(view: View): View
operator fun I.minus(margin: Int): SideConstraint
operator fun SideConstraint.minus(view: View): View
operator fun SinglePartialConstraint.minus(side: I): View
operator fun Array<View>.minus(side: I): Array<View>
operator fun Array<View>.minus(margin: Int): MultiplePartialConstraint
Link copied to clipboard
fun View.modifyMargin(left: Int? = null, top: Int? = null, right: Int? = null, bottom: Int? = null)
Link copied to clipboard
fun View.modifyPadding(left: Int? = null, top: Int? = null, right: Int? = null, bottom: Int? = null)
Link copied to clipboard
fun View.moveView(left: Int, top: Int)
Link copied to clipboard
fun View.moveViewRelatively(left: Int, top: Int)
Link copied to clipboard
Link copied to clipboard
fun CompoundButton.onChecked(onChecked: (View, Boolean) -> Unit)
Link copied to clipboard
inline fun <T : View> T.onClick(crossinline func: T.() -> Unit)
Link copied to clipboard
inline fun <V : View> V.onFirstAttachToWindow(crossinline whenAttached: (view: View) -> Unit)
Link copied to clipboard
inline fun <T : View> T.onGlobalLayout(crossinline func: T.() -> Unit)
Link copied to clipboard
inline fun <T : Adapter> AdapterView<T>.onItemSelected(crossinline action: (parent: AdapterView<*>?, view: View?, position: Int, id: Long) -> Unit = { _, _, _, _ -> })
Link copied to clipboard
inline fun <T : View> T.onLongClick(crossinline func: T.() -> Unit)
Link copied to clipboard
fun ViewPager.onPageScrollStateChanged(onPageScrollStateChanged: (Int) -> Unit)
Link copied to clipboard
inline fun <T : View> T.onPreDraw(crossinline func: T.() -> Unit)
Link copied to clipboard
fun SeekBar.onProgressChanged(callback: (theSeekBar: SeekBar, progress: Int, fromUser: Boolean) -> Unit)
Link copied to clipboard
fun BottomSheetBehavior<*>.onSlide(onSlide: (bottomSheet: View, slideOffset: Float) -> Unit = { _, _ -> }): BottomSheetBehavior.BottomSheetCallback
Link copied to clipboard
fun BottomSheetBehavior<*>.onStateChanged(onStateChanged: (bottomSheet: View, newState: Int) -> Unit = { _, _ -> }): BottomSheetBehavior.BottomSheetCallback
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Pad this view with the insets provided by the device cutout (i.e. notch)

Link copied to clipboard

Adds a leading zero if only one digit

Link copied to clipboard
fun <T : View> T.percentHeight(value: Float): T
Link copied to clipboard
fun <T : View> T.percentWidth(value: Float): T
Link copied to clipboard
fun View.pinchToZoom(scaleFactor: Float = 1.0f): ScaleGestureDetector

Declare a variable private var gestureDetector: ScaleGestureDetector? = null

Link copied to clipboard
fun <T : View> T.position(position: Int, margin: Int): T
Link copied to clipboard
inline fun <T : View> T.postApply(crossinline block: T.() -> Unit)
Link copied to clipboard
inline fun <T : View> T.postDelayedApply(delay: Long, crossinline block: T.() -> Unit)
Link copied to clipboard
inline fun <T : View> T.postDelayedLet(delay: Long, crossinline block: (T) -> Unit)
Link copied to clipboard
inline fun <T : View> T.postLet(crossinline block: (T) -> Unit)

Post functions

Link copied to clipboard
fun View.px(@DimenRes rid: Int): Int
Link copied to clipboard
fun px2dip(context: Context, pxValue: Float): Int
Link copied to clipboard
fun Number.pxToDp(context: Context? = null): Float
Link copied to clipboard
fun Number.pxToSp(context: Context? = null): Float
Link copied to clipboard
fun View.quantityString(@PluralsRes resourceId: Int, quantity: Int, vararg args: Any?): String
Link copied to clipboard
inline fun View.readAttributes(attrs: AttributeSet?, styleableArray: IntArray, crossinline block: TypedArray.() -> Unit)

Reads the file attributes safely

Link copied to clipboard
fun View.relativeMargins(left: Int, top: Int, right: Int, bottom: Int)

Sets margins for views in Relative Layout

Link copied to clipboard
Link copied to clipboard

Remove views by tag ViewGroup.

Link copied to clipboard

Call View.requestApplyInsets in a safe away. If we're attached it calls it straight-away. If not it sets an View.OnAttachStateChangeListener and waits to be attached before calling View.requestApplyInsets.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun View.resize(width: Int, height: Int)
Link copied to clipboard
fun View.returnMeasurements(widthMeasureSpec: Int, heightMeasureSpec: Int, measurements: (widthMode: Int, heightMode: Int, widthSize: Int, heightSize: Int, initialWidth: Int, initialHeight: Int) -> Unit = { _, _, _, _, _, _ -> })

Use in View.onMeasure to simplify measurements

Link copied to clipboard
fun <T : View> T.right(margin: Int): T
Link copied to clipboard
Link copied to clipboard
fun View.rotateAnimation(rotation: Float, duration: Long)

Animates the view to rotate, can be refactored for more abstraction if needed

Link copied to clipboard
fun View.rotationAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard
fun View.rotationXAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard
fun View.rotationYAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard
fun View.scale(scale: Float)
Link copied to clipboard
fun View.scaleXAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard
fun View.scaleYAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard

Create a Screnshot of the view and returns it as a Bitmap

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

Gives focus to the passed view once the view has been completely inflated

Link copied to clipboard
Link copied to clipboard
fun View.setHeight(newValue: Int)
Link copied to clipboard
Link copied to clipboard
fun TabLayout.setIcons(icons: TypedArray)
fun TabLayout.setIcons(@DrawableRes icons: IntArray)
fun TabLayout.setIcons(icons: List<Drawable>)
Link copied to clipboard
Link copied to clipboard
fun View.setLayoutHeight(height: Int)
Link copied to clipboard
fun View.setLightStatusBar(condition: Boolean = true)
Link copied to clipboard
fun View.setMargin(left: Int, top: Int, right: Int, bottom: Int)
Link copied to clipboard
fun View.setMargins(size: Int)

Sets margins for views

fun View.setMargins(left: Int, top: Int, right: Int, bottom: Int)
Link copied to clipboard
fun View.setNewHeight(value: Int)
Link copied to clipboard
fun View.setNewWidth(value: Int)
Link copied to clipboard
inline fun View.setOnClickListenerCooldown(coolDown: Long = 1000, crossinline action: (view: View) -> Unit)

Sets an on click listener for a view, but ensures the action cannot be triggered more often than coolDown milliseconds.

Link copied to clipboard
inline fun View.setOnSingleTapListener(crossinline onSingleTap: (v: View, event: MotionEvent) -> Unit)

Creates an on touch listener that only emits on a short single tap

Link copied to clipboard
Link copied to clipboard
fun View.setPaddingEnd(value: Int)
Link copied to clipboard
Link copied to clipboard
fun View.setPaddingLeft(value: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun View.setPaddingTop(value: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun View.setSemiTransparentIf(shouldBeTransparent: Boolean, disabledAlpha: Float = 0.3f)
Link copied to clipboard
fun View.setSize(height: Int, width: Int)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Making notification bar transparent

Link copied to clipboard
fun TextInputLayout.setTextInputLayoutUpperHintColor(@ColorInt color: Int)
Link copied to clipboard
Link copied to clipboard
fun FloatingActionButton.setTint(color: Int)

Change Floating action button tint

Link copied to clipboard
Link copied to clipboard

Gives focus to the passed view once the view has been completely inflated using view.requestFocusFromTouch

Link copied to clipboard
fun View.setWidth(newValue: Int)
Link copied to clipboard
Link copied to clipboard

SHows all child views

Link copied to clipboard
fun View.showIf(boolean: Boolean, makeInvisible: Boolean = false)

will show the view If Condition is true else make if INVISIBLE or GONE Based on the makeInvisible flag

Link copied to clipboard
fun View.showPopup(@MenuRes menuResourceId: Int, onInit: PopupMenu.() -> Unit = {}, onClick: (MenuItem) -> Boolean)

Displays a popup by inflating menu with specified menu resource id, calling onClick when an item is clicked, and optionally calling onInit with PopupMenu as receiver to initialize prior to display.

Link copied to clipboard

Shows the soft input for the vindow.

Link copied to clipboard
fun showViews(vararg views: View)

Shows all the views passed in the arguments

Link copied to clipboard
fun Context.showViews(vararg views: View)

Shows all the views passed as argument(s)

Link copied to clipboard
fun <T : View> T.size(value: Int): T
Link copied to clipboard
fun BottomSheetBehavior<*>.sliderListener(onSlide: (bottomSheet: View, slideOffset: Float) -> Unit = { _, _ -> }, onStateChanged: (bottomSheet: View, newState: Int) -> Unit = { _, _ -> })
Link copied to clipboard
fun View.snack(msg: CharSequence, @ColorRes colorResId: Int? = null, duration: Int = Snackbar.LENGTH_SHORT, build: Snackbar.() -> Unit? = null)
Link copied to clipboard
fun View.snackbar(message: Int, duration: Int = Snackbar.LENGTH_SHORT, actionName: Int = 0, actionTextColor: Int = 0, action: (View) -> Unit = {}): Snackbar
fun View.snackbar(message: Int, duration: Int = Snackbar.LENGTH_SHORT, actionName: String = "", actionTextColor: Int = 0, action: (View) -> Unit = {}): Snackbar
fun View.snackbar(message: String, duration: Int = Snackbar.LENGTH_SHORT, actionName: Int = 0, actionTextColor: Int = 0, action: (View) -> Unit = {}): Snackbar
fun View.snackbar(message: String, duration: Int = Snackbar.LENGTH_SHORT, actionName: String = "", actionTextColor: Int = 0, action: (View) -> Unit = {}): Snackbar
Link copied to clipboard
fun Number.spToPx(context: Context? = null): Float
Link copied to clipboard

Sets top margin for views in Linear Layout

Link copied to clipboard
fun View.startMargin(size: Int)

Sets top margin for views

Link copied to clipboard

Sets top margin for views in Relative Layout

Link copied to clipboard
fun View.string(@StringRes resourceId: Int): String
fun View.string(@StringRes resourceId: Int, vararg args: Any?): String
Link copied to clipboard
inline fun <T : View> T.style(block: T.() -> Unit): T
Link copied to clipboard
fun ViewGroup.subviews(vararg views: View): View
Link copied to clipboard
fun TabLayout.Tabs(): List<TabLayout.Tab>
Link copied to clipboard
Link copied to clipboard
fun SearchView.textListener(onQuerySubmit: (queryTextSubmit: String) -> Unit = { _ -> }, onQueryChange: (queryTextChange: String) -> Unit = { _ -> })
Link copied to clipboard
fun Context.themeAttributeToColor(themeAttributeId: Int, fallbackColor: Int = Color.WHITE): Int
Link copied to clipboard
fun TabLayout.tint(selectedPosition: Int = 0, selectedColor: Int = ContextCompat.getColor(context, android.R.color.white), defaultColor: Int = Color.parseColor("#80FFFFFF"))
Link copied to clipboard

Convert this Drawable to Bitmap representation. Should take care of every Drawable type

Get a screenshot of the View, support a long screenshot of the entire RecyclerView list Note: When calling this method, please make sure the View has been measured. If the width and height are 0, an exception will be thrown.

Link copied to clipboard
Link copied to clipboard
fun toggleArrow(show: Boolean, view: View, delay: Boolean = true): Boolean
Link copied to clipboard
fun View.toggleArrow(duration: Long = 200): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun TextInputLayout.toggleTextHintColorOnEmpty(activeColor: Int, inactiveColor: Int)
Link copied to clipboard
Link copied to clipboard

INVISIBLE TO GONE AND OTHERWISE

Link copied to clipboard

INVISIBLE TO VISIBLE AND OTHERWISE

Link copied to clipboard
fun <T : View> T.top(margin: Int): T
Link copied to clipboard

Sets top margin for views in Linear Layout

Link copied to clipboard
fun View.topMargin(size: Int)

Sets top margin for views

Link copied to clipboard

Sets top margin for views in Relative Layout

Link copied to clipboard
fun View.translationXAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard
fun View.translationYAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard
fun View.translationZAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun TabLayout.updateTabAt(position: Int, @StringRes title: Int, @DrawableRes icon: Int, @LayoutRes customView: Int)
Link copied to clipboard
fun View.visibilityChangeListener(onVisibility: (isVisible: Boolean) -> Unit)
Link copied to clipboard
Link copied to clipboard
inline fun View.visibleIf(block: () -> Boolean)

Visible if condition met

Link copied to clipboard
inline fun View.visibleIfElseGone(block: () -> Boolean)

Visible if condition met else gone

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T : View> T.width(value: Float): T
fun <T : View> T.width(value: Int): T
Link copied to clipboard
Link copied to clipboard

Method to simplify the code needed to apply spans on a specific sub string.

Link copied to clipboard
fun View.xAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard
fun View.yAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator
Link copied to clipboard
fun View.zAnimator(values: FloatArray, duration: Long = 300, repeatCount: Int = 0, repeatMode: Int = 0): Animator