L
- the ComponentLifecycle
of the Component
that this builder will
build.T
- the type of this builder. Required to ensure methods defined here in the abstract
class correctly return the type of the concrete subclass.public abstract static class Component.Builder<L extends ComponentLifecycle,T extends Component.Builder<L,T>> extends ResourceResolver
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
T |
alignSelf(YogaAlign alignSelf) |
T |
alpha(float alpha) |
T |
aspectRatio(float aspectRatio) |
T |
background(Drawable background) |
T |
background(Reference.Builder<? extends Drawable> builder) |
T |
background(Reference<? extends Drawable> background) |
T |
backgroundAttr(int resId) |
T |
backgroundAttr(int resId,
int defaultResId) |
T |
backgroundColor(int backgroundColor) |
T |
backgroundRes(int resId) |
T |
border(Border border) |
abstract Component<L> |
build() |
ComponentLayout |
buildWithLayout() |
protected static void |
checkArgs(int requiredPropsCount,
BitSet required,
String[] requiredPropsNames)
Checks that all the required props are supplied, and if not throws a useful exception
|
T |
clickHandler(EventHandler<ClickEvent> clickHandler) |
T |
clipToOutline(boolean clipToOutline) |
T |
contentDescription(CharSequence contentDescription) |
T |
contentDescription(int stringId) |
T |
contentDescription(int stringId,
Object... formatArgs) |
T |
dispatchPopulateAccessibilityEventHandler(EventHandler<DispatchPopulateAccessibilityEventEvent> dispatchPopulateAccessibilityEventHandler) |
T |
duplicateParentState(boolean duplicateParentState) |
T |
enabled(boolean isEnabled) |
T |
flex(float flex) |
T |
flexBasisAttr(int resId) |
T |
flexBasisAttr(int resId,
int defaultResId) |
T |
flexBasisDip(float flexBasis) |
T |
flexBasisPercent(float percent) |
T |
flexBasisPx(int flexBasis) |
T |
flexBasisRes(int resId) |
T |
flexGrow(float flexGrow) |
T |
flexShrink(float flexShrink) |
T |
focusable(boolean isFocusable) |
T |
focusChangeHandler(EventHandler<FocusChangedEvent> focusChangeHandler) |
T |
focusedHandler(EventHandler<FocusedVisibleEvent> focusedHandler) |
T |
foreground(Drawable foreground) |
T |
foregroundAttr(int resId) |
T |
foregroundAttr(int resId,
int defaultResId) |
T |
foregroundColor(int foregroundColor) |
T |
foregroundRes(int resId) |
T |
fullImpressionHandler(EventHandler<FullImpressionVisibleEvent> fullImpressionHandler) |
abstract T |
getThis() |
T |
heightAttr(int resId) |
T |
heightAttr(int resId,
int defaultResId) |
T |
heightDip(float height) |
T |
heightPercent(float percent) |
T |
heightPx(int height) |
T |
heightRes(int resId) |
T |
importantForAccessibility(int importantForAccessibility) |
protected void |
init(ComponentContext c,
int defStyleAttr,
int defStyleRes,
Component<L> component) |
T |
interceptTouchHandler(EventHandler<InterceptTouchEvent> interceptTouchHandler) |
T |
invisibleHandler(EventHandler<InvisibleEvent> invisibleHandler) |
T |
key(String key)
Set a key on the component that is local to its parent.
|
T |
layoutDirection(YogaDirection layoutDirection) |
T |
longClickHandler(EventHandler<LongClickEvent> longClickHandler) |
T |
marginAttr(YogaEdge edge,
int resId) |
T |
marginAttr(YogaEdge edge,
int resId,
int defaultResId) |
T |
marginAuto(YogaEdge edge) |
T |
marginDip(YogaEdge edge,
float margin) |
T |
marginPercent(YogaEdge edge,
float percent) |
T |
marginPx(YogaEdge edge,
int margin) |
T |
marginRes(YogaEdge edge,
int resId) |
T |
maxHeightAttr(int resId) |
T |
maxHeightAttr(int resId,
int defaultResId) |
T |
maxHeightDip(float maxHeight) |
T |
maxHeightPercent(float percent) |
T |
maxHeightPx(int maxHeight) |
T |
maxHeightRes(int resId) |
T |
maxWidthAttr(int resId) |
T |
maxWidthAttr(int resId,
int defaultResId) |
T |
maxWidthDip(float maxWidth) |
T |
maxWidthPercent(float percent) |
T |
maxWidthPx(int maxWidth) |
T |
maxWidthRes(int resId) |
T |
minHeightAttr(int resId) |
T |
minHeightAttr(int resId,
int defaultResId) |
T |
minHeightDip(float minHeight) |
T |
minHeightPercent(float percent) |
T |
minHeightPx(int minHeight) |
T |
minHeightRes(int resId) |
T |
minWidthAttr(int resId) |
T |
minWidthAttr(int resId,
int defaultResId) |
T |
minWidthDip(float minWidth) |
T |
minWidthPercent(float percent) |
T |
minWidthPx(int minWidth) |
T |
minWidthRes(int resId) |
T |
onInitializeAccessibilityEventHandler(EventHandler<OnInitializeAccessibilityEventEvent> onInitializeAccessibilityEventHandler) |
T |
onInitializeAccessibilityNodeInfoHandler(EventHandler<OnInitializeAccessibilityNodeInfoEvent> onInitializeAccessibilityNodeInfoHandler) |
T |
onPopulateAccessibilityEventHandler(EventHandler<OnPopulateAccessibilityEventEvent> onPopulateAccessibilityEventHandler) |
T |
onRequestSendAccessibilityEventHandler(EventHandler<OnRequestSendAccessibilityEventEvent> onRequestSendAccessibilityEventHandler) |
T |
outlineProvider(ViewOutlineProvider outlineProvider) |
T |
paddingAttr(YogaEdge edge,
int resId) |
T |
paddingAttr(YogaEdge edge,
int resId,
int defaultResId) |
T |
paddingDip(YogaEdge edge,
float padding) |
T |
paddingPercent(YogaEdge edge,
float percent) |
T |
paddingPx(YogaEdge edge,
int padding) |
T |
paddingRes(YogaEdge edge,
int resId) |
T |
performAccessibilityActionHandler(EventHandler<PerformAccessibilityActionEvent> performAccessibilityActionHandler) |
T |
positionAttr(YogaEdge edge,
int resId) |
T |
positionAttr(YogaEdge edge,
int resId,
int defaultResId) |
T |
positionDip(YogaEdge edge,
float position) |
T |
positionPercent(YogaEdge edge,
float percent) |
T |
positionPx(YogaEdge edge,
int position) |
T |
positionRes(YogaEdge edge,
int resId) |
T |
positionType(YogaPositionType positionType) |
protected void |
release() |
T |
scale(float scale) |
T |
sendAccessibilityEventHandler(EventHandler<SendAccessibilityEventEvent> sendAccessibilityEventHandler) |
T |
sendAccessibilityEventUncheckedHandler(EventHandler<SendAccessibilityEventUncheckedEvent> sendAccessibilityEventUncheckedHandler) |
T |
shadowElevationAttr(int resId) |
T |
shadowElevationAttr(int resId,
int defaultResId) |
T |
shadowElevationDip(float shadowElevation) |
T |
shadowElevationPx(float shadowElevation) |
T |
shadowElevationRes(int resId) |
T |
testKey(String testKey) |
T |
touchExpansionAttr(YogaEdge edge,
int resId) |
T |
touchExpansionAttr(YogaEdge edge,
int resId,
int defaultResId) |
T |
touchExpansionDip(YogaEdge edge,
float touchExpansion) |
T |
touchExpansionPx(YogaEdge edge,
int touchExpansion) |
T |
touchExpansionRes(YogaEdge edge,
int resId) |
T |
touchHandler(EventHandler<TouchEvent> touchHandler) |
T |
transitionKey(String key) |
T |
unfocusedHandler(EventHandler<UnfocusedVisibleEvent> unfocusedHandler) |
T |
viewTag(Object viewTag) |
T |
viewTags(<any> viewTags) |
T |
visibleHandler(EventHandler<VisibleEvent> visibleHandler) |
T |
visibleHeightRatio(float visibleHeightRatio) |
T |
visibleWidthRatio(float visibleWidthRatio) |
T |
widthAttr(int resId) |
T |
widthAttr(int resId,
int defaultResId) |
T |
widthDip(float width) |
T |
widthPercent(float percent) |
T |
widthPx(int width) |
T |
widthRes(int resId) |
ComponentLayout.Builder |
withLayout()
Deprecated.
You no longer need to use this method in order to add layout attributes, you can
just add them directly to the component.
|
T |
wrapInView() |
dipsToPixels, init, resolveBoolAttr, resolveBoolRes, resolveColorAttr, resolveColorRes, resolveDimenOffsetAttr, resolveDimenOffsetRes, resolveDimenSizeAttr, resolveDimenSizeRes, resolveDrawableAttr, resolveDrawableRes, resolveFloatAttr, resolveFloatRes, resolveIntArrayAttr, resolveIntAttr, resolveIntegerArrayAttr, resolveIntegerArrayRes, resolveIntRes, resolveStringArrayAttr, resolveStringArrayRes, resolveStringAttr, resolveStringRes, resolveStringRes, sipsToPixels
protected void init(ComponentContext c, @AttrRes int defStyleAttr, @StyleRes int defStyleRes, Component<L> component)
public abstract T getThis()
protected void release()
release
in class ResourceResolver
protected static void checkArgs(int requiredPropsCount, BitSet required, String[] requiredPropsNames)
requiredPropsCount
- expected number of propsrequired
- the bit set that identifies which props have been suppliedrequiredPropsNames
- the names of all props used for a useful error messagepublic final ComponentLayout buildWithLayout()
@Deprecated public final ComponentLayout.Builder withLayout()
public T layoutDirection(YogaDirection layoutDirection)
public T positionType(YogaPositionType positionType)
public T flex(float flex)
public T flexGrow(float flexGrow)
public T flexShrink(float flexShrink)
public T flexBasisPercent(float percent)
public T flexBasisDip(@Dimension(unit=0) float flexBasis)
public T importantForAccessibility(int importantForAccessibility)
public T duplicateParentState(boolean duplicateParentState)
public T marginDip(YogaEdge edge, @Dimension(unit=0) float margin)
public T paddingDip(YogaEdge edge, @Dimension(unit=0) float padding)
public T positionDip(YogaEdge edge, @Dimension(unit=0) float position)
public T widthPercent(float percent)
public T widthDip(@Dimension(unit=0) float width)
public T minWidthPercent(float percent)
public T minWidthDip(@Dimension(unit=0) float minWidth)
public T maxWidthPercent(float percent)
public T maxWidthDip(@Dimension(unit=0) float maxWidth)
public T heightPercent(float percent)
public T heightDip(@Dimension(unit=0) float height)
public T minHeightPercent(float percent)
public T minHeightDip(@Dimension(unit=0) float minHeight)
public T maxHeightPercent(float percent)
public T maxHeightDip(@Dimension(unit=0) float maxHeight)
public T aspectRatio(float aspectRatio)
public T touchExpansionAttr(YogaEdge edge, @AttrRes int resId, @DimenRes int defaultResId)
public T touchExpansionDip(YogaEdge edge, @Dimension(unit=0) float touchExpansion)
public T background(Reference.Builder<? extends Drawable> builder)
public T background(Drawable background)
public T backgroundAttr(@AttrRes int resId, @DrawableRes int defaultResId)
public T backgroundRes(@DrawableRes int resId)
public T backgroundColor(int backgroundColor)
public T foreground(Drawable foreground)
public T foregroundAttr(@AttrRes int resId, @DrawableRes int defaultResId)
public T foregroundRes(@DrawableRes int resId)
public T foregroundColor(int foregroundColor)
public T wrapInView()
public T clickHandler(EventHandler<ClickEvent> clickHandler)
public T longClickHandler(EventHandler<LongClickEvent> longClickHandler)
public T focusChangeHandler(EventHandler<FocusChangedEvent> focusChangeHandler)
public T touchHandler(EventHandler<TouchEvent> touchHandler)
public T interceptTouchHandler(EventHandler<InterceptTouchEvent> interceptTouchHandler)
public T focusable(boolean isFocusable)
public T enabled(boolean isEnabled)
public T visibleHeightRatio(float visibleHeightRatio)
public T visibleWidthRatio(float visibleWidthRatio)
public T visibleHandler(EventHandler<VisibleEvent> visibleHandler)
public T focusedHandler(EventHandler<FocusedVisibleEvent> focusedHandler)
public T unfocusedHandler(EventHandler<UnfocusedVisibleEvent> unfocusedHandler)
public T fullImpressionHandler(EventHandler<FullImpressionVisibleEvent> fullImpressionHandler)
public T invisibleHandler(EventHandler<InvisibleEvent> invisibleHandler)
public T contentDescription(CharSequence contentDescription)
public T contentDescription(@StringRes int stringId)
public T contentDescription(@StringRes int stringId, Object... formatArgs)
public T viewTags(<any> viewTags)
public T shadowElevationPx(float shadowElevation)
public T shadowElevationDip(@Dimension(unit=0) float shadowElevation)
public T outlineProvider(ViewOutlineProvider outlineProvider)
public T clipToOutline(boolean clipToOutline)
public T dispatchPopulateAccessibilityEventHandler(EventHandler<DispatchPopulateAccessibilityEventEvent> dispatchPopulateAccessibilityEventHandler)
public T onInitializeAccessibilityEventHandler(EventHandler<OnInitializeAccessibilityEventEvent> onInitializeAccessibilityEventHandler)
public T onInitializeAccessibilityNodeInfoHandler(EventHandler<OnInitializeAccessibilityNodeInfoEvent> onInitializeAccessibilityNodeInfoHandler)
public T onPopulateAccessibilityEventHandler(EventHandler<OnPopulateAccessibilityEventEvent> onPopulateAccessibilityEventHandler)
public T onRequestSendAccessibilityEventHandler(EventHandler<OnRequestSendAccessibilityEventEvent> onRequestSendAccessibilityEventHandler)
public T performAccessibilityActionHandler(EventHandler<PerformAccessibilityActionEvent> performAccessibilityActionHandler)
public T sendAccessibilityEventHandler(EventHandler<SendAccessibilityEventEvent> sendAccessibilityEventHandler)
public T sendAccessibilityEventUncheckedHandler(EventHandler<SendAccessibilityEventUncheckedEvent> sendAccessibilityEventUncheckedHandler)
public T alpha(float alpha)
public T scale(float scale)