@Test public void testGetParagraphCount() { final Params param = new Params.Builder(PAINT).build(); final PrecomputedTextCompat pm = PrecomputedTextCompat.create(STRING, param); assertEquals(1, pm.getParagraphCount()); assertEquals(0, pm.getParagraphStart(0)); assertEquals(STRING.length(), pm.getParagraphEnd(0)); final PrecomputedTextCompat pm1 = PrecomputedTextCompat.create(MULTIPARA_STRING, param); assertEquals(2, pm1.getParagraphCount()); assertEquals(0, pm1.getParagraphStart(0)); assertEquals(7, pm1.getParagraphEnd(0)); assertEquals(7, pm1.getParagraphStart(1)); assertEquals(pm1.length(), pm1.getParagraphEnd(1)); }
public @IntRange(from = 0) int getParagraphCount() { if (BuildCompat.isAtLeastP()) { return mWrapped.getParagraphCount(); } else { return mParagraphEnds.length; } }
PrecomputedTextCompat implements Spannable { public @IntRange(from = 0) int getParagraphCount() { if (BuildCompat.isAtLeastP()) { return mWrapped.getParagraphCount(); } else { return mParagraphEnds.length; } } }
PrecomputedTextCompat implements Spannable { public @IntRange(from = 0) int getParagraphCount() { if (BuildCompat.isAtLeastP()) { return mWrapped.getParagraphCount(); } else { return mParagraphEnds.length; } } private  PrecomputedTextCompat(@NonNull CharSequence text, @NonNull Params params,
            @NonNull int[] paraEnds); @RequiresApi(28) private  PrecomputedTextCompat(@NonNull PrecomputedText precomputed, @NonNull Params params); }
PrecomputedTextCompat implements Spannable { public @IntRange(from = 0) int getParagraphCount() { if (BuildCompat.isAtLeastP()) { return mWrapped.getParagraphCount(); } else { return mParagraphEnds.length; } } private  PrecomputedTextCompat(@NonNull CharSequence text, @NonNull Params params,
            @NonNull int[] paraEnds); @RequiresApi(28) private  PrecomputedTextCompat(@NonNull PrecomputedText precomputed, @NonNull Params params); static PrecomputedTextCompat create(@NonNull CharSequence text, @NonNull Params params); @NonNull Params getParams(); @IntRange(from = 0) int getParagraphCount(); @IntRange(from = 0) int getParagraphStart(@IntRange(from = 0) int paraIndex); @IntRange(from = 0) int getParagraphEnd(@IntRange(from = 0) int paraIndex); @Override void setSpan(Object what, int start, int end, int flags); @Override void removeSpan(Object what); @Override T[] getSpans(int start, int end, Class<T> type); @Override int getSpanStart(Object tag); @Override int getSpanEnd(Object tag); @Override int getSpanFlags(Object tag); @Override int nextSpanTransition(int start, int limit, Class type); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int start, int end); @Override String toString(); }
PrecomputedTextCompat implements Spannable { public @IntRange(from = 0) int getParagraphCount() { if (BuildCompat.isAtLeastP()) { return mWrapped.getParagraphCount(); } else { return mParagraphEnds.length; } } private  PrecomputedTextCompat(@NonNull CharSequence text, @NonNull Params params,
            @NonNull int[] paraEnds); @RequiresApi(28) private  PrecomputedTextCompat(@NonNull PrecomputedText precomputed, @NonNull Params params); static PrecomputedTextCompat create(@NonNull CharSequence text, @NonNull Params params); @NonNull Params getParams(); @IntRange(from = 0) int getParagraphCount(); @IntRange(from = 0) int getParagraphStart(@IntRange(from = 0) int paraIndex); @IntRange(from = 0) int getParagraphEnd(@IntRange(from = 0) int paraIndex); @Override void setSpan(Object what, int start, int end, int flags); @Override void removeSpan(Object what); @Override T[] getSpans(int start, int end, Class<T> type); @Override int getSpanStart(Object tag); @Override int getSpanEnd(Object tag); @Override int getSpanFlags(Object tag); @Override int nextSpanTransition(int start, int limit, Class type); @Override int length(); @Override char charAt(int index); @Override CharSequence subSequence(int start, int end); @Override String toString();  }