ViewExtensions

View extensions

Functions

Link copied to clipboard
fun View.animateViewHeight(from: Int, to: Int, duration: Long, interpolator: Interpolator = LinearInterpolator(), doOnEnd: (Animator) -> Unit? = null)

Smoothly animates view's height from size to desired size

Link copied to clipboard
fun View.blink(duration: Long, repeatCount: Int)

Apply a blink animation the the view

Link copied to clipboard
fun View.setAlphaWithAnimation(targetAlpha: Float, duration: Long)

Set the alpha with a fade animation

Link copied to clipboard

Set the bottom padding for a view

Link copied to clipboard
@RequiresApi(value = 17)
fun View.setPaddingEnd(@Px px: Int)

Set the end padding for a view

Link copied to clipboard

Set the horizontal padding for a view

Link copied to clipboard

Set the left padding for a view

Link copied to clipboard

Set the right padding for a view

Link copied to clipboard
@RequiresApi(value = 17)
fun View.setPaddingStart(@Px px: Int)

Set the start padding for a view

Link copied to clipboard

Set the top padding for a view

Link copied to clipboard

Set the vertical padding for a view