public abstract class ReactBaseTextShadowNode extends LayoutShadowNode
ReactShadowNode
abstract class for spannable text nodes.
This class handles all text attributes assosiated with <Text>
-ish node. A concrete
node can be an anchor <Text>
node, an anchor <TextInput>
node or virtual <Text>
node inside <Text>
or <TextInput>
node. Or even something else.
This also node calculates Spannable
object based on subnodes of the same type, which
can be used in concrete classes to feed native views and compute layout.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TEXT_SHADOW_COLOR |
protected boolean |
mAllowFontScaling |
protected int |
mBackgroundColor |
protected int |
mColor |
protected boolean |
mContainsImages |
protected java.lang.String |
mFontFamily
NB: If a font family is used that does not have a style in a certain Android version (ie.
|
protected int |
mFontSize |
protected float |
mFontSizeInput |
protected int |
mFontStyle
mFontStyle can be
Typeface.NORMAL or Typeface.ITALIC . |
protected int |
mFontWeight |
protected float |
mHeightOfTallestInlineImage |
protected boolean |
mIncludeFontPadding |
protected boolean |
mIsBackgroundColorSet |
protected boolean |
mIsColorSet |
protected boolean |
mIsLineThroughTextDecorationSet |
protected boolean |
mIsUnderlineTextDecorationSet |
protected float |
mLetterSpacing |
protected float |
mLetterSpacingInput |
protected float |
mLineHeight |
protected float |
mLineHeightInput |
protected int |
mNumberOfLines |
protected int |
mTextAlign |
protected int |
mTextBreakStrategy |
protected int |
mTextShadowColor |
protected float |
mTextShadowOffsetDx |
protected float |
mTextShadowOffsetDy |
protected float |
mTextShadowRadius |
static java.lang.String |
PROP_SHADOW_COLOR |
static java.lang.String |
PROP_SHADOW_OFFSET |
static java.lang.String |
PROP_SHADOW_OFFSET_HEIGHT |
static java.lang.String |
PROP_SHADOW_OFFSET_WIDTH |
static java.lang.String |
PROP_SHADOW_RADIUS |
static int |
UNSET |
Constructor and Description |
---|
ReactBaseTextShadowNode() |
ReactBaseTextShadowNode(ReactBaseTextShadowNode node) |
Modifier and Type | Method and Description |
---|---|
float |
getEffectiveLineHeight() |
void |
setAllowFontScaling(boolean allowFontScaling) |
void |
setBackgroundColor(java.lang.Integer color) |
void |
setColor(java.lang.Integer color) |
void |
setFontFamily(java.lang.String fontFamily) |
void |
setFontSize(float fontSize) |
void |
setFontStyle(java.lang.String fontStyleString)
/* This code is duplicated in ReactTextInputManager
/* TODO: Factor into a common place they can both use
|
void |
setFontWeight(java.lang.String fontWeightString)
/* This code is duplicated in ReactTextInputManager
/* TODO: Factor into a common place they can both use
|
void |
setIncludeFontPadding(boolean includepad) |
void |
setLetterSpacing(float letterSpacing) |
void |
setLineHeight(float lineHeight) |
void |
setNumberOfLines(int numberOfLines) |
void |
setTextAlign(java.lang.String textAlign) |
void |
setTextBreakStrategy(java.lang.String textBreakStrategy) |
void |
setTextDecorationLine(java.lang.String textDecorationLineString) |
void |
setTextShadowColor(int textShadowColor) |
void |
setTextShadowOffset(ReadableMap offsetMap) |
void |
setTextShadowRadius(float textShadowRadius) |
protected static android.text.Spannable |
spannedFromShadowNode(ReactBaseTextShadowNode textShadowNode,
java.lang.String text) |
copy, setAlignContent, setAlignItems, setAlignSelf, setAspectRatio, setBorderWidths, setDisplay, setFlex, setFlexBasis, setFlexDirection, setFlexGrow, setFlexShrink, setFlexWrap, setHeight, setJustifyContent, setMargins, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOverflow, setPaddings, setPosition, setPositionValues, setShouldNotifyOnLayout, setWidth
addChildAt, addNativeChildAt, calculateLayout, dirty, dispatchUpdates, dispose, getChildAt, getChildCount, getChildrenList, getHierarchyInfo, getInstanceHandle, getLayoutDirection, getLayoutHeight, getLayoutWidth, getLayoutX, getLayoutY, getNativeChildCount, getNativeOffsetForChild, getNativeParent, getNewProps, getOriginalReactShadowNode, getPadding, getParent, getReactTag, getRootTag, getScreenHeight, getScreenWidth, getScreenX, getScreenY, getStyleHeight, getStylePadding, getStyleWidth, getThemedContext, getTotalNativeChildren, getViewClass, hasNewLayout, hasUnseenUpdates, hasUpdates, indexOf, indexOfNativeChild, isDescendantOf, isDirty, isLayoutOnly, isMeasureDefined, isVirtual, isVirtualAnchor, isYogaLeafNode, markLayoutSeen, markUpdated, markUpdateSeen, mutableCopy, mutableCopyWithNewChildren, mutableCopyWithNewChildrenAndProps, mutableCopyWithNewProps, onAfterUpdateTransaction, onBeforeLayout, onCollectExtraUpdates, removeAllNativeChildren, removeAndDisposeAllChildren, removeChildAt, removeNativeChildAt, setAlignContent, setAlignItems, setAlignSelf, setBaselineFunction, setBorder, setDefaultPadding, setDisplay, setFlexBasis, setFlexBasisAuto, setFlexBasisPercent, setFlexDirection, setFlexWrap, setInstanceHandle, setIsLayoutOnly, setJustifyContent, setLayoutDirection, setLocalData, setMargin, setMarginAuto, setMarginPercent, setMeasureFunction, setOriginalReactShadowNode, setOverflow, setPadding, setPaddingPercent, setPosition, setPositionPercent, setPositionType, setReactTag, setRootTag, setStyleAspectRatio, setStyleHeight, setStyleHeightAuto, setStyleHeightPercent, setStyleMaxHeight, setStyleMaxHeightPercent, setStyleMaxWidth, setStyleMaxWidthPercent, setStyleMinHeight, setStyleMinHeightPercent, setStyleMinWidth, setStyleMinWidthPercent, setStyleWidth, setStyleWidthAuto, setStyleWidthPercent, setThemedContext, setViewClassName, shouldNotifyOnLayout, toString, updateProperties
public static final int UNSET
public static final java.lang.String PROP_SHADOW_OFFSET
public static final java.lang.String PROP_SHADOW_OFFSET_WIDTH
public static final java.lang.String PROP_SHADOW_OFFSET_HEIGHT
public static final java.lang.String PROP_SHADOW_RADIUS
public static final java.lang.String PROP_SHADOW_COLOR
public static final int DEFAULT_TEXT_SHADOW_COLOR
protected float mLineHeight
protected float mLetterSpacing
protected boolean mIsColorSet
protected boolean mAllowFontScaling
protected int mColor
protected boolean mIsBackgroundColorSet
protected int mBackgroundColor
protected int mNumberOfLines
protected int mFontSize
protected float mFontSizeInput
protected float mLineHeightInput
protected float mLetterSpacingInput
protected int mTextAlign
protected int mTextBreakStrategy
protected float mTextShadowOffsetDx
protected float mTextShadowOffsetDy
protected float mTextShadowRadius
protected int mTextShadowColor
protected boolean mIsUnderlineTextDecorationSet
protected boolean mIsLineThroughTextDecorationSet
protected boolean mIncludeFontPadding
protected int mFontStyle
Typeface.NORMAL
or Typeface.ITALIC
.
mFontWeight can be Typeface.NORMAL
or Typeface.BOLD
.protected int mFontWeight
@Nullable protected java.lang.String mFontFamily
protected boolean mContainsImages
protected float mHeightOfTallestInlineImage
public ReactBaseTextShadowNode()
public ReactBaseTextShadowNode(ReactBaseTextShadowNode node)
protected static android.text.Spannable spannedFromShadowNode(ReactBaseTextShadowNode textShadowNode, java.lang.String text)
public float getEffectiveLineHeight()
public void setNumberOfLines(int numberOfLines)
public void setLineHeight(float lineHeight)
public void setLetterSpacing(float letterSpacing)
public void setAllowFontScaling(boolean allowFontScaling)
public void setTextAlign(@Nullable java.lang.String textAlign)
public void setFontSize(float fontSize)
public void setColor(@Nullable java.lang.Integer color)
public void setBackgroundColor(java.lang.Integer color)
public void setFontFamily(@Nullable java.lang.String fontFamily)
public void setFontWeight(@Nullable java.lang.String fontWeightString)
public void setFontStyle(@Nullable java.lang.String fontStyleString)
public void setIncludeFontPadding(boolean includepad)
public void setTextDecorationLine(@Nullable java.lang.String textDecorationLineString)
public void setTextBreakStrategy(@Nullable java.lang.String textBreakStrategy)
public void setTextShadowOffset(ReadableMap offsetMap)
public void setTextShadowRadius(float textShadowRadius)
public void setTextShadowColor(int textShadowColor)