public abstract class ReactBaseTextShadowNode extends LayoutShadowNode
ReactShadowNode
abstract class for spannable text nodes.
This class handles all text attributes associated 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 |
mAdjustsFontSizeToFit |
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 java.lang.String |
mFontFeatureSettings |
protected int |
mFontStyle
mFontStyle can be
Typeface.NORMAL or Typeface.ITALIC . |
protected int |
mFontWeight |
protected int |
mHyphenationFrequency |
protected boolean |
mIncludeFontPadding |
protected java.util.Map<java.lang.Integer,ReactShadowNode> |
mInlineViews |
protected boolean |
mIsBackgroundColorSet |
protected boolean |
mIsColorSet |
protected boolean |
mIsLineThroughTextDecorationSet |
protected boolean |
mIsUnderlineTextDecorationSet |
protected int |
mJustificationMode |
protected float |
mMinimumFontScale |
protected int |
mNumberOfLines |
protected ReactTextViewManagerCallback |
mReactTextViewManagerCallback |
protected int |
mTextAlign |
protected TextAttributes |
mTextAttributes |
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 java.lang.String |
PROP_TEXT_TRANSFORM |
static int |
UNSET |
Constructor and Description |
---|
ReactBaseTextShadowNode() |
ReactBaseTextShadowNode(ReactTextViewManagerCallback reactTextViewManagerCallback) |
Modifier and Type | Method and Description |
---|---|
void |
setAdjustFontSizeToFit(boolean adjustsFontSizeToFit) |
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) |
void |
setFontVariant(ReadableArray fontVariantArray) |
void |
setFontWeight(java.lang.String fontWeightString) |
void |
setIncludeFontPadding(boolean includepad) |
void |
setLetterSpacing(float letterSpacing) |
void |
setLineHeight(float lineHeight) |
void |
setMaxFontSizeMultiplier(float maxFontSizeMultiplier) |
void |
setMinimumFontScale(float minimumFontScale) |
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) |
void |
setTextTransform(java.lang.String textTransform) |
protected android.text.Spannable |
spannedFromShadowNode(ReactBaseTextShadowNode textShadowNode,
java.lang.String text,
boolean supportsInlineViews,
NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer) |
setAlignContent, setAlignItems, setAlignSelf, setAspectRatio, setBorderWidths, setCollapsable, setDisplay, setFlex, setFlexBasis, setFlexDirection, setFlexGrow, setFlexShrink, setFlexWrap, setHeight, setJustifyContent, setMargins, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOverflow, setPaddings, setPosition, setPositionValues, setShouldNotifyOnLayout, setWidth
addChildAt, addNativeChildAt, calculateLayout, calculateLayout, calculateLayoutOnChildren, dirty, dispatchUpdates, dispose, getChildAt, getChildCount, getHeightMeasureSpec, getHierarchyInfo, getLayoutDirection, getLayoutHeight, getLayoutParent, getLayoutWidth, getLayoutX, getLayoutY, getNativeChildCount, getNativeKind, getNativeOffsetForChild, getNativeParent, getPadding, getParent, getReactTag, getRootTag, getScreenHeight, getScreenWidth, getScreenX, getScreenY, getStyleHeight, getStylePadding, getStyleWidth, getThemedContext, getTotalNativeChildren, getViewClass, getWidthMeasureSpec, hasNewLayout, hasUnseenUpdates, hasUpdates, hoistNativeChildren, indexOf, indexOfNativeChild, isDescendantOf, isDirty, isLayoutOnly, isMeasureDefined, isVirtual, isVirtualAnchor, isYogaLeafNode, markLayoutSeen, markUpdated, markUpdateSeen, onAfterUpdateTransaction, onBeforeLayout, onCollectExtraUpdates, removeAllNativeChildren, removeAndDisposeAllChildren, removeChildAt, removeNativeChildAt, setAlignContent, setAlignItems, setAlignSelf, setBaselineFunction, setBorder, setDefaultPadding, setDisplay, setFlexBasis, setFlexBasisAuto, setFlexBasisPercent, setFlexDirection, setFlexWrap, setIsLayoutOnly, setJustifyContent, setLayoutDirection, setLayoutParent, setLocalData, setMargin, setMarginAuto, setMarginPercent, setMeasureFunction, setMeasureSpecs, 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 java.lang.String PROP_TEXT_TRANSFORM
public static final int DEFAULT_TEXT_SHADOW_COLOR
protected ReactTextViewManagerCallback mReactTextViewManagerCallback
protected TextAttributes mTextAttributes
protected boolean mIsColorSet
protected int mColor
protected boolean mIsBackgroundColorSet
protected int mBackgroundColor
protected int mNumberOfLines
protected int mTextAlign
protected int mTextBreakStrategy
protected int mHyphenationFrequency
protected int mJustificationMode
protected float mTextShadowOffsetDx
protected float mTextShadowOffsetDy
protected float mTextShadowRadius
protected int mTextShadowColor
protected boolean mIsUnderlineTextDecorationSet
protected boolean mIsLineThroughTextDecorationSet
protected boolean mIncludeFontPadding
protected boolean mAdjustsFontSizeToFit
protected float mMinimumFontScale
protected int mFontStyle
Typeface.NORMAL
or Typeface.ITALIC
. mFontWeight can be Typeface.NORMAL
or Typeface.BOLD
.protected int mFontWeight
protected java.lang.String mFontFamily
Example, Android 4.4:
Bold Text Bold Text Bold Text Not Bold Text Not Bold Text Not Bold Text Not Bold Text Bold Text Bold Text
protected java.lang.String mFontFeatureSettings
Paint.setFontFeatureSettings(java.lang.String)
protected boolean mContainsImages
protected java.util.Map<java.lang.Integer,ReactShadowNode> mInlineViews
public ReactBaseTextShadowNode()
public ReactBaseTextShadowNode(ReactTextViewManagerCallback reactTextViewManagerCallback)
protected android.text.Spannable spannedFromShadowNode(ReactBaseTextShadowNode textShadowNode, java.lang.String text, boolean supportsInlineViews, NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer)
public void setNumberOfLines(int numberOfLines)
public void setLineHeight(float lineHeight)
public void setLetterSpacing(float letterSpacing)
public void setAllowFontScaling(boolean allowFontScaling)
public void setMaxFontSizeMultiplier(float maxFontSizeMultiplier)
public void setTextAlign(java.lang.String textAlign)
public void setFontSize(float fontSize)
public void setColor(java.lang.Integer color)
public void setBackgroundColor(java.lang.Integer color)
public void setFontFamily(java.lang.String fontFamily)
public void setFontWeight(java.lang.String fontWeightString)
public void setFontVariant(ReadableArray fontVariantArray)
public void setFontStyle(java.lang.String fontStyleString)
public void setIncludeFontPadding(boolean includepad)
public void setTextDecorationLine(java.lang.String textDecorationLineString)
public void setTextBreakStrategy(java.lang.String textBreakStrategy)
public void setTextShadowOffset(ReadableMap offsetMap)
public void setTextShadowRadius(float textShadowRadius)
public void setTextShadowColor(int textShadowColor)
public void setTextTransform(java.lang.String textTransform)
public void setAdjustFontSizeToFit(boolean adjustsFontSizeToFit)
public void setMinimumFontScale(float minimumFontScale)