Package org.robolectric.shadows
Class ShadowNativeStaticLayout
java.lang.Object
org.robolectric.shadows.ShadowNativeStaticLayout
@Implements(value=android.text.StaticLayout.class,
minSdk=26,
maxSdk=28,
shadowPicker=Picker.class)
public class ShadowNativeStaticLayout
extends Object
Shadow for
StaticLayout that is backed by native code for Android O-P. In Android Q, the
native methods relate to text layout were heavily refactored and moved to MeasuredText and
LineBreaker.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidnAddMeasuredRun(long nativePtr, int start, int end, float[] widths) protected static voidnAddReplacementRun(long nativePtr, int start, int end, float width) protected static floatnAddStyleRun(long nativePtr, long nativePaint, long nativeTypeface, int start, int end, boolean isRtl) protected static intnComputeLineBreaks(long nativePtr, char[] text, long measuredTextPtr, int length, float firstWidth, int firstWidthLineCount, float restWidth, int[] variableTabStopsObject, int defaultTabStop, int indentsOffset, Object recycle, int recycleLength, int[] recycleBreaks, float[] recycleWidths, float[] recycleAscents, float[] recycleDescents, int[] recycleFlags, float[] charWidths) protected static intnComputeLineBreaks(long nativePtr, Object recycle, int[] recycleBreaksObject, float[] recycleWidthsObject, int[] recycleFlagsObject, int recycleLength) protected static voidnFinish(long nativePtr) protected static voidnFinishBuilder(long nativePtr) protected static voidnFreeBuilder(long nativePtr) protected static voidnGetWidths(long nativePtr, float[] widths) protected static longnInit(int breakStrategy, int hyphenationFrequency, boolean isJustified, int[] indents, int[] leftPaddings, int[] rightPaddings) protected static longnLoadHyphenator(ByteBuffer buf, int offset, int minPrefix, int minSuffix) protected static longprotected static voidnSetIndents(long nativePtr, int[] indents) protected static voidnSetLocale(long nativePtr, String locale, long nativeHyphenator) protected static voidnSetupParagraph(long nativePtr, char[] text, int length, float firstWidth, int firstWidthLineCount, float restWidth, int[] variableTabStops, int defaultTabStop, int breakStrategy, int hyphenationFrequency, boolean isJustified)
-
Constructor Details
-
ShadowNativeStaticLayout
public ShadowNativeStaticLayout()
-
-
Method Details
-
nInit
@Implementation(minSdk=28, maxSdk=28) protected static long nInit(int breakStrategy, int hyphenationFrequency, boolean isJustified, int[] indents, int[] leftPaddings, int[] rightPaddings) -
nFinish
-
nComputeLineBreaks
@Implementation(minSdk=28, maxSdk=28) protected static int nComputeLineBreaks(long nativePtr, char[] text, long measuredTextPtr, int length, float firstWidth, int firstWidthLineCount, float restWidth, int[] variableTabStopsObject, int defaultTabStop, int indentsOffset, Object recycle, int recycleLength, int[] recycleBreaks, float[] recycleWidths, float[] recycleAscents, float[] recycleDescents, int[] recycleFlags, float[] charWidths) -
nNewBuilder
-
nFreeBuilder
-
nFinishBuilder
-
nLoadHyphenator
@Implementation(minSdk=26, maxSdk=27) protected static long nLoadHyphenator(ByteBuffer buf, int offset, int minPrefix, int minSuffix) -
nSetLocale
@Implementation(minSdk=26, maxSdk=26) protected static void nSetLocale(long nativePtr, String locale, long nativeHyphenator) -
nSetIndents
@Implementation(minSdk=26, maxSdk=27) protected static void nSetIndents(long nativePtr, int[] indents) -
nSetupParagraph
@Implementation(minSdk=26, maxSdk=27) protected static void nSetupParagraph(long nativePtr, char[] text, int length, float firstWidth, int firstWidthLineCount, float restWidth, int[] variableTabStops, int defaultTabStop, int breakStrategy, int hyphenationFrequency, boolean isJustified) -
nAddStyleRun
@Implementation(minSdk=26, maxSdk=27) protected static float nAddStyleRun(long nativePtr, long nativePaint, long nativeTypeface, int start, int end, boolean isRtl) -
nAddMeasuredRun
@Implementation(maxSdk=27) protected static void nAddMeasuredRun(long nativePtr, int start, int end, float[] widths) -
nAddReplacementRun
@Implementation(maxSdk=27) protected static void nAddReplacementRun(long nativePtr, int start, int end, float width) -
nGetWidths
-
nComputeLineBreaks
@Implementation(maxSdk=27) protected static int nComputeLineBreaks(long nativePtr, Object recycle, int[] recycleBreaksObject, float[] recycleWidthsObject, int[] recycleFlagsObject, int recycleLength)
-