-
- All Implemented Interfaces:
-
com.airbnb.paris.proxies.Proxy
public final class ViewProxy extends BaseProxy<ViewProxy, View>
The order of the methods in a styleable class dictates the order in which attributes are applied. This class relies on this fact to enforce the precedence of paddings. It's unorthodox but it simplifies the logic quite a bit. DO NOT RELY ON THIS UNDOCUMENTED FEATURE IF YOUR PROJECT IMPORTS THIS LIBRARY.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classViewProxy.Companion
-
Method Summary
-
-
Constructor Detail
-
ViewProxy
ViewProxy(View view)
-
-
Method Detail
-
afterStyle
final Unit afterStyle(Style style)
-
setLayoutWidth
final Unit setLayoutWidth(Integer width)
-
setLayoutHeight
final Unit setLayoutHeight(Integer height)
-
setLayoutGravity
final Unit setLayoutGravity(Integer gravity)
-
setLayoutWeight
final Unit setLayoutWeight(@FloatRange(from = 0.0.toDouble()) Float weight)
Set layout weight on LinearLayout.
- Parameters:
weight- The weight.
-
setLayoutMarginHorizontal
@RequiresApi(value = 26) final Unit setLayoutMarginHorizontal(@Px() Integer marginHorizontal)
-
setLayoutMarginVertical
@RequiresApi(value = 26) final Unit setLayoutMarginVertical(@Px() Integer marginVertical)
-
setLayoutMarginBottom
final Unit setLayoutMarginBottom(@Px() Integer marginBottom)
-
setLayoutMarginLeft
final Unit setLayoutMarginLeft(@Px() Integer marginLeft)
-
setLayoutMarginRight
final Unit setLayoutMarginRight(@Px() Integer marginRight)
-
setLayoutMarginTop
final Unit setLayoutMarginTop(@Px() Integer marginTop)
-
setLayoutMarginEnd
final Unit setLayoutMarginEnd(@Px() Integer marginEnd)
-
setLayoutMarginStart
final Unit setLayoutMarginStart(@Px() Integer marginStart)
-
setLayoutMargin
final Unit setLayoutMargin(@Px() Integer margin)
-
setBackground
final Unit setBackground(Drawable drawable)
-
setBackgroundTint
final Unit setBackgroundTint(ColorStateList colorStateList)
-
setBackgroundTintMode
final Unit setBackgroundTintMode(Integer tintMode)
-
setClickable
final Unit setClickable(Boolean clickable)
-
setContentDescription
final Unit setContentDescription(CharSequence contentDescription)
-
setElevation
final Unit setElevation(@Px() Integer elevation)
android:elevation attribute and View.setElevation() method are supported since Lollipop. ViewCompat version of setElevation() method is available, but currently doesn't have any effect on pre-Lollipop devices. Also, requesting android:elevation attribute value gives some unpredicted values on some Kitkat-based Samsung devices (see https://github.com/airbnb/paris/issues/73). That's why we're parsing android:elevation attribute only when running Lollipop and use View.setElevation() for now.
-
setFocusable
final Unit setFocusable(Boolean focusable)
-
setForeground
@RequiresApi(value = 23) final Unit setForeground(Drawable drawable)
-
setMinHeight
final Unit setMinHeight(@Px() Integer minHeight)
-
setMinWidth
final Unit setMinWidth(@Px() Integer minWidth)
-
setPaddingBottom
final Unit setPaddingBottom(@Px() Integer padding)
-
setPaddingLeft
final Unit setPaddingLeft(@Px() Integer padding)
-
setPaddingRight
final Unit setPaddingRight(@Px() Integer padding)
-
setPaddingTop
final Unit setPaddingTop(@Px() Integer padding)
-
setPaddingHorizontal
final Unit setPaddingHorizontal(@Px() Integer padding)
-
setPaddingVertical
final Unit setPaddingVertical(@Px() Integer padding)
-
setPadding
final Unit setPadding(@Px() Integer padding)
-
setPaddingEnd
final Unit setPaddingEnd(@Px() Integer padding)
-
setPaddingStart
final Unit setPaddingStart(@Px() Integer padding)
-
setStateListAnimator
final Unit setStateListAnimator(@AnyRes() Integer animatorRes)
-
setVisibility
final Unit setVisibility(Integer visibility)
-
setIgnoreLayoutWidthAndHeight
final Unit setIgnoreLayoutWidthAndHeight(Boolean ignore)
-
setImportantForAccessibility
final Unit setImportantForAccessibility(Integer mode)
-
-
-
-