@Test public void testSubSequence() { final SpannableBuilder spannable = new SpannableBuilder(mClass, "abc"); final QuoteSpan span1 = mock(QuoteSpan.class); final QuoteSpan span2 = mock(QuoteSpan.class); spannable.setSpan(span1, 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); spannable.setSpan(span2, 2, 3, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); final CharSequence subsequence = spannable.subSequence(0, 1); assertNotNull(subsequence); assertThat(subsequence, instanceOf(SpannableBuilder.class)); final QuoteSpan[] spans = spannable.getSpans(0, 1, QuoteSpan.class); assertThat(spans, arrayWithSize(1)); assertSame(spans[0], span1); }
@Override public CharSequence subSequence(int start, int end) { return new SpannableBuilder(mWatcherClass, this, start, end); }
SpannableBuilder extends SpannableStringBuilder { @Override public CharSequence subSequence(int start, int end) { return new SpannableBuilder(mWatcherClass, this, start, end); } }
SpannableBuilder extends SpannableStringBuilder { @Override public CharSequence subSequence(int start, int end) { return new SpannableBuilder(mWatcherClass, this, start, end); } @RestrictTo(LIBRARY_GROUP)  SpannableBuilder(@NonNull Class<?> watcherClass); @RestrictTo(LIBRARY_GROUP)  SpannableBuilder(@NonNull Class<?> watcherClass, @NonNull CharSequence text); @RestrictTo(LIBRARY_GROUP)  SpannableBuilder(@NonNull Class<?> watcherClass, @NonNull CharSequence text, int start,
            int end); }
SpannableBuilder extends SpannableStringBuilder { @Override public CharSequence subSequence(int start, int end) { return new SpannableBuilder(mWatcherClass, this, start, end); } @RestrictTo(LIBRARY_GROUP)  SpannableBuilder(@NonNull Class<?> watcherClass); @RestrictTo(LIBRARY_GROUP)  SpannableBuilder(@NonNull Class<?> watcherClass, @NonNull CharSequence text); @RestrictTo(LIBRARY_GROUP)  SpannableBuilder(@NonNull Class<?> watcherClass, @NonNull CharSequence text, int start,
            int end); @Override CharSequence subSequence(int start, int end); @Override void setSpan(Object what, int start, int end, int flags); @SuppressWarnings("unchecked") @Override T[] getSpans(int queryStart, int queryEnd, Class<T> kind); @Override void removeSpan(Object what); @Override int getSpanStart(Object tag); @Override int getSpanEnd(Object tag); @Override int getSpanFlags(Object tag); @Override int nextSpanTransition(int start, int limit, Class type); @RestrictTo(LIBRARY_GROUP) void beginBatchEdit(); @RestrictTo(LIBRARY_GROUP) void endBatchEdit(); @Override SpannableStringBuilder replace(int start, int end, CharSequence tb); @Override SpannableStringBuilder replace(int start, int end, CharSequence tb, int tbstart,
            int tbend); @Override SpannableStringBuilder insert(int where, CharSequence tb); @Override SpannableStringBuilder insert(int where, CharSequence tb, int start, int end); @Override SpannableStringBuilder delete(int start, int end); @Override SpannableStringBuilder append(CharSequence text); @Override SpannableStringBuilder append(char text); @Override SpannableStringBuilder append(CharSequence text, int start, int end); @Override SpannableStringBuilder append(CharSequence text, Object what, int flags); }
SpannableBuilder extends SpannableStringBuilder { @Override public CharSequence subSequence(int start, int end) { return new SpannableBuilder(mWatcherClass, this, start, end); } @RestrictTo(LIBRARY_GROUP)  SpannableBuilder(@NonNull Class<?> watcherClass); @RestrictTo(LIBRARY_GROUP)  SpannableBuilder(@NonNull Class<?> watcherClass, @NonNull CharSequence text); @RestrictTo(LIBRARY_GROUP)  SpannableBuilder(@NonNull Class<?> watcherClass, @NonNull CharSequence text, int start,
            int end); @Override CharSequence subSequence(int start, int end); @Override void setSpan(Object what, int start, int end, int flags); @SuppressWarnings("unchecked") @Override T[] getSpans(int queryStart, int queryEnd, Class<T> kind); @Override void removeSpan(Object what); @Override int getSpanStart(Object tag); @Override int getSpanEnd(Object tag); @Override int getSpanFlags(Object tag); @Override int nextSpanTransition(int start, int limit, Class type); @RestrictTo(LIBRARY_GROUP) void beginBatchEdit(); @RestrictTo(LIBRARY_GROUP) void endBatchEdit(); @Override SpannableStringBuilder replace(int start, int end, CharSequence tb); @Override SpannableStringBuilder replace(int start, int end, CharSequence tb, int tbstart,
            int tbend); @Override SpannableStringBuilder insert(int where, CharSequence tb); @Override SpannableStringBuilder insert(int where, CharSequence tb, int start, int end); @Override SpannableStringBuilder delete(int start, int end); @Override SpannableStringBuilder append(CharSequence text); @Override SpannableStringBuilder append(char text); @Override SpannableStringBuilder append(CharSequence text, int start, int end); @Override SpannableStringBuilder append(CharSequence text, Object what, int flags);  }