-
public final class ViewBindingAdaptersKt
-
-
Method Summary
Modifier and Type Method Description final static Integervisibility(Boolean visibility)Convert true/false to View.VISIBLE and View. final static UnitanimatedVisibility(View $self, Boolean visibility)Animate view visibility true/false to View.VISIBLE and View. final static UnitanimatedVisibilityAlpha(View $self, Boolean visibility)Animate view visibility true/false to View.VISIBLE and View. final static UnitsetBackground(View $self, @DrawableRes() Integer resId)final static UnitanimatedMarginStart(View $self, Integer pixels, Integer duration)Animate android:layout_marginStart from original value to new value specified in pixels final static UnitanimatedMarginEnd(View $self, Integer pixels, Integer duration)Animate android:layout_marginEnd from original value to new value specified in pixels final static UnitanimatedColor(View $self, Drawable drawable, Integer duration)Animate view background color with TransitionDrawable final static UnitanimateElevation(View $self, Integer pixels, Integer duration)Animate view elevation from original value to new value specified in pixels final static UnitonFocusChanged(View $self, View.OnFocusChangeListener listener)Set onFocusChangedListener -
-
Method Detail
-
visibility
final static Integer visibility(Boolean visibility)
Convert true/false to View.VISIBLE and View.GONE
- Parameters:
visibility- boolean to convert
-
animatedVisibility
final static Unit animatedVisibility(View $self, Boolean visibility)
Animate view visibility true/false to View.VISIBLE and View.GONE
- Parameters:
visibility- final visible state
-
animatedVisibilityAlpha
final static Unit animatedVisibilityAlpha(View $self, Boolean visibility)
Animate view visibility true/false to View.VISIBLE and View.INVISIBLE
- Parameters:
visibility- final visible state
-
setBackground
final static Unit setBackground(View $self, @DrawableRes() Integer resId)
-
animatedMarginStart
final static Unit animatedMarginStart(View $self, Integer pixels, Integer duration)
Animate android:layout_marginStart from original value to new value specified in pixels
- Parameters:
pixels- final marginduration- animation duration
-
animatedMarginEnd
final static Unit animatedMarginEnd(View $self, Integer pixels, Integer duration)
Animate android:layout_marginEnd from original value to new value specified in pixels
- Parameters:
pixels- final marginduration- animation duration
-
animatedColor
final static Unit animatedColor(View $self, Drawable drawable, Integer duration)
Animate view background color with TransitionDrawable
- Parameters:
drawable- TransitionDrawableduration- animation duration
-
animateElevation
@RequiresApi(value = 21) final static Unit animateElevation(View $self, Integer pixels, Integer duration)
Animate view elevation from original value to new value specified in pixels
- Parameters:
pixels- final elevationduration- animation duration
-
onFocusChanged
final static Unit onFocusChanged(View $self, View.OnFocusChangeListener listener)
Set onFocusChangedListener
- Parameters:
listener- View.
-
-
-
-