Class ShadowNativeStaticLayout


  • @Implements(value=android.text.StaticLayout.class,
                minSdk=26,
                maxSdk=28,
                looseSignatures=true,
                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.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      protected static void nAddMeasuredRun​(long nativePtr, int start, int end, float[] widths)  
      protected static void nAddReplacementRun​(long nativePtr, int start, int end, float width)  
      protected static float nAddStyleRun​(long nativePtr, long nativePaint, long nativeTypeface, int start, int end, boolean isRtl)  
      protected static int nComputeLineBreaks​(Object nativePtr, Object recycle, Object recycleBreaksObject, Object recycleWidthsObject, Object recycleFlagsObject, Object recycleLength)
      This has to use looseSignatures due to recycle param with non-public type android.text.StaticLayout$LineBreaks.
      protected static int nComputeLineBreaks​(Object nativePtr, Object text, Object measuredTextPtr, Object length, Object firstWidth, Object firstWidthLineCount, Object restWidth, Object variableTabStopsObject, Object defaultTabStop, Object indentsOffset, Object recycle, Object recycleLength, Object recycleBreaks, Object recycleWidths, Object recycleAscents, Object recycleDescents, Object recycleFlags, Object charWidths)
      This has to use looseSignatures due to recycle param with non-public type android.text.StaticLayout$LineBreaks.
      protected static void nFinish​(long nativePtr)  
      protected static void nFinishBuilder​(long nativePtr)  
      protected static void nFreeBuilder​(long nativePtr)  
      protected static void nGetWidths​(long nativePtr, float[] widths)  
      protected static long nInit​(int breakStrategy, int hyphenationFrequency, boolean isJustified, int[] indents, int[] leftPaddings, int[] rightPaddings)  
      protected static long nLoadHyphenator​(ByteBuffer buf, int offset, int minPrefix, int minSuffix)  
      protected static long nNewBuilder()  
      protected static void nSetIndents​(long nativePtr, int[] indents)  
      protected static void nSetLocale​(long nativePtr, String locale, long nativeHyphenator)  
      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)  
    • Constructor Detail

      • ShadowNativeStaticLayout

        public ShadowNativeStaticLayout()
    • Method Detail

      • nInit

        @Implementation(minSdk=28,
                        maxSdk=28)
        protected static long nInit​(int breakStrategy,
                                    int hyphenationFrequency,
                                    boolean isJustified,
                                    int[] indents,
                                    int[] leftPaddings,
                                    int[] rightPaddings)
      • nFinish

        @Implementation(minSdk=28,
                        maxSdk=28)
        protected static void nFinish​(long nativePtr)
      • nComputeLineBreaks

        @Implementation(minSdk=28,
                        maxSdk=28)
        protected static int nComputeLineBreaks​(Object nativePtr,
                                                Object text,
                                                Object measuredTextPtr,
                                                Object length,
                                                Object firstWidth,
                                                Object firstWidthLineCount,
                                                Object restWidth,
                                                Object variableTabStopsObject,
                                                Object defaultTabStop,
                                                Object indentsOffset,
                                                Object recycle,
                                                Object recycleLength,
                                                Object recycleBreaks,
                                                Object recycleWidths,
                                                Object recycleAscents,
                                                Object recycleDescents,
                                                Object recycleFlags,
                                                Object charWidths)
        This has to use looseSignatures due to recycle param with non-public type android.text.StaticLayout$LineBreaks.
      • nNewBuilder

        @Implementation(minSdk=26,
                        maxSdk=27)
        protected static long nNewBuilder()
      • nFreeBuilder

        @Implementation(minSdk=26,
                        maxSdk=27)
        protected static void nFreeBuilder​(long nativePtr)
      • nFinishBuilder

        @Implementation(minSdk=26,
                        maxSdk=27)
        protected static void nFinishBuilder​(long nativePtr)
      • nLoadHyphenator

        @Implementation(minSdk=26,
                        maxSdk=27)
        protected static long nLoadHyphenator​(ByteBuffer buf,
                                              int offset,
                                              int minPrefix,
                                              int minSuffix)
      • nSetLocale

        @Implementation(minSdk=26,
                        maxSdk=27)
        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
        protected static void nAddMeasuredRun​(long nativePtr,
                                              int start,
                                              int end,
                                              float[] widths)
      • nAddReplacementRun

        @Implementation
        protected static void nAddReplacementRun​(long nativePtr,
                                                 int start,
                                                 int end,
                                                 float width)
      • nGetWidths

        @Implementation
        protected static void nGetWidths​(long nativePtr,
                                         float[] widths)
      • nComputeLineBreaks

        @Implementation
        protected static int nComputeLineBreaks​(Object nativePtr,
                                                Object recycle,
                                                Object recycleBreaksObject,
                                                Object recycleWidthsObject,
                                                Object recycleFlagsObject,
                                                Object recycleLength)
        This has to use looseSignatures due to recycle param with non-public type android.text.StaticLayout$LineBreaks.