Home
last modified time | relevance | path

Searched refs:spans (Results 1 – 25 of 36) sorted by relevance

12

/frameworks/base/core/tests/coretests/src/android/text/
DSpannableTest.java36 Object[] spans; in testGetSpans() local
41 spans = spannable.getSpans(0, 1, Object.class); in testGetSpans()
42 MoreAsserts.assertEquals(new Object[]{emptySpan}, spans); in testGetSpans()
43 spans = spannable.getSpans(0, 2, Object.class); in testGetSpans()
44 MoreAsserts.assertEquals(new Object[]{emptySpan, unemptySpan}, spans); in testGetSpans()
45 spans = spannable.getSpans(1, 2, Object.class); in testGetSpans()
46 MoreAsserts.assertEquals(new Object[]{emptySpan, unemptySpan}, spans); in testGetSpans()
47 spans = spannable.getSpans(2, 2, Object.class); in testGetSpans()
48 MoreAsserts.assertEquals(new Object[]{unemptySpan}, spans); in testGetSpans()
DTextUtilsTest.java136 private void checkContains(Spanned text, String[] spans, String spanName, in checkContains() argument
138 for (String i: spans) { in checkContains()
152 String[] spans; in testTemplateSpan() local
164 spans = result.getSpans(0, result.length(), String.class); in testTemplateSpan()
167 assertEquals(4, spans.length); in testTemplateSpan()
168 checkContains(result, spans, "before", 0, 1); in testTemplateSpan()
169 checkContains(result, spans, "during", 1, 4); in testTemplateSpan()
170 checkContains(result, spans, "after", 4, 5); in testTemplateSpan()
171 checkContains(result, spans, "during+after", 1, 5); in testTemplateSpan()
178 spans = result.getSpans(0, result.length(), String.class); in testTemplateSpan()
[all …]
DSpannedTest.java121 Object[] spans = s.getSpans(0, s.length(), Object.class); in checkPriority() local
123 for (int i = 0; i < spans.length - 1; i++) { in checkPriority()
124 assertEquals((s.getSpanFlags(spans[i]) & Spanned.SPAN_PRIORITY) >= in checkPriority()
125 (s.getSpanFlags(spans[i + 1]) & Spanned.SPAN_PRIORITY), in checkPriority()
/frameworks/base/core/java/android/text/
DSpannableStringInternal.java40 Object[] spans = sp.getSpans(start, end, Object.class); in SpannableStringInternal() local
42 for (int i = 0; i < spans.length; i++) { in SpannableStringInternal()
43 int st = sp.getSpanStart(spans[i]); in SpannableStringInternal()
44 int en = sp.getSpanEnd(spans[i]); in SpannableStringInternal()
45 int fl = sp.getSpanFlags(spans[i]); in SpannableStringInternal()
52 setSpan(spans[i], st - start, en - start, fl); in SpannableStringInternal()
102 Object[] spans = mSpans; in setSpan() local
106 if (spans[i] == what) { in setSpan()
143 Object[] spans = mSpans; in removeSpan() local
147 if (spans[i] == what) { in removeSpan()
[all …]
DSpanSet.java34 E[] spans; field in SpanSet
49 if (length > 0 && (spans == null || spans.length < length)) { in init()
51 spans = (E[]) Array.newInstance(classType, length); in init()
67 spans[numberOfSpans] = span; in init()
108 spans[i] = null; // prevent a leak: no reference kept when TextLine is recycled in recycle()
DSpannableStringBuilder.java74 Object[] spans = sp.getSpans(start, end, Object.class); in SpannableStringBuilder() local
76 for (int i = 0; i < spans.length; i++) { in SpannableStringBuilder()
77 if (spans[i] instanceof NoCopySpan) { in SpannableStringBuilder()
81 int st = sp.getSpanStart(spans[i]) - start; in SpannableStringBuilder()
82 int en = sp.getSpanEnd(spans[i]) - start; in SpannableStringBuilder()
83 int fl = sp.getSpanFlags(spans[i]); in SpannableStringBuilder()
95 setSpan(false, spans[i], st, en, fl); in SpannableStringBuilder()
380 Object[] spans = sp.getSpans(csStart, csEnd, Object.class); in change() local
382 for (int i = 0; i < spans.length; i++) { in change()
383 int st = sp.getSpanStart(spans[i]); in change()
[all …]
DLayout.java215 ParagraphStyle[] spans = NO_PARA_SPANS; in drawText() local
260 spans = getParagraphSpans(sp, start, spanEnd, ParagraphStyle.class); in drawText()
263 for (int n = spans.length - 1; n >= 0; n--) { in drawText()
264 if (spans[n] instanceof AlignmentSpan) { in drawText()
265 paraAlign = ((AlignmentSpan) spans[n]).getAlignment(); in drawText()
275 final int length = spans.length; in drawText()
278 if (spans[n] instanceof LeadingMarginSpan2) { in drawText()
279 int count = ((LeadingMarginSpan2) spans[n]).getLeadingMarginLineCount(); in drawText()
280 int startLine = getLineForOffset(sp.getSpanStart(spans[n])); in drawText()
290 if (spans[n] instanceof LeadingMarginSpan) { in drawText()
[all …]
DMeasuredText.java110 ReplacementSpan[] spans = spanned.getSpans(start, end, in setPara() local
113 for (int i = 0; i < spans.length; i++) { in setPara()
114 int startInPara = spanned.getSpanStart(spans[i]) - start; in setPara()
115 int endInPara = spanned.getSpanEnd(spans[i]) - start; in setPara()
183 float addStyleRun(TextPaint paint, MetricAffectingSpan[] spans, int len, in addStyleRun() argument
192 for (int i = 0; i < spans.length; i++) { in addStyleRun()
193 MetricAffectingSpan span = spans[i]; in addStyleRun()
DTextUtils.java950 ReplacementSpan[] spans = ((Spanned) text).getSpans(offset, offset, in getOffsetBefore() local
953 for (int i = 0; i < spans.length; i++) { in getOffsetBefore()
954 int start = ((Spanned) text).getSpanStart(spans[i]); in getOffsetBefore()
955 int end = ((Spanned) text).getSpanEnd(spans[i]); in getOffsetBefore()
987 ReplacementSpan[] spans = ((Spanned) text).getSpans(offset, offset, in getOffsetAfter() local
990 for (int i = 0; i < spans.length; i++) { in getOffsetAfter()
991 int start = ((Spanned) text).getSpanStart(spans[i]); in getOffsetAfter()
992 int end = ((Spanned) text).getSpanEnd(spans[i]); in getOffsetAfter()
1024 Object[] spans = source.getSpans(start, end, kind); in copySpansFrom() local
1026 for (int i = 0; i < spans.length; i++) { in copySpansFrom()
[all …]
DTextLine.java647 MetricAffectingSpan[] spans = mSpanned.getSpans(mStart + spanStart, in getOffsetBeforeAfter() local
649 spans = TextUtils.removeEmptySpans(spans, mSpanned, MetricAffectingSpan.class); in getOffsetBeforeAfter()
651 if (spans.length > 0) { in getOffsetBeforeAfter()
653 for (int j = 0; j < spans.length; j++) { in getOffsetBeforeAfter()
654 MetricAffectingSpan span = spans[j]; in getOffsetBeforeAfter()
928 MetricAffectingSpan span = mMetricAffectingSpanSpanSet.spans[j]; in handleRun()
954 CharacterStyle span = mCharacterStyleSpanSet.spans[k]; in handleRun()
1007 MetricAffectingSpan[] spans = mSpanned.getSpans(pos, pos + 1, MetricAffectingSpan.class); in ascent() local
1008 if (spans.length == 0) { in ascent()
1014 for (MetricAffectingSpan span : spans) { in ascent()
DStaticLayout.java282 MetricAffectingSpan[] spans = in generate() local
284 spans = TextUtils.removeEmptySpans(spans, spanned, MetricAffectingSpan.class); in generate()
285 measured.addStyleRun(paint, spans, spanLen, fm); in generate()
304 TabStopSpan[] spans = getParagraphSpans(spanned, paraStart, in generate() local
306 if (spans.length > 0) { in generate()
307 tabStops = new TabStops(TAB_INCREMENT, spans); in generate()
DDynamicLayout.java179 ChangeWatcher[] spans = sp.getSpans(0, sp.length(), ChangeWatcher.class); in DynamicLayout() local
180 for (int i = 0; i < spans.length; i++) in DynamicLayout()
181 sp.removeSpan(spans[i]); in DynamicLayout()
/frameworks/base/core/jni/
Dandroid_util_StringBlock.cpp107 const ResStringPool_span* spans = osb->styleAt(idx); in android_content_StringBlock_nativeGetStyle() local
108 if (spans == NULL) { in android_content_StringBlock_nativeGetStyle()
112 const ResStringPool_span* pos = spans; in android_content_StringBlock_nativeGetStyle()
130 while (spans->name.index != ResStringPool_span::END) { in android_content_StringBlock_nativeGetStyle()
133 (jint*)spans); in android_content_StringBlock_nativeGetStyle()
134 spans++; in android_content_StringBlock_nativeGetStyle()
/frameworks/base/tools/aapt/
DStringPool.h78 entry_style(const entry_style& o) : offset(o.offset), spans(o.spans) { } in entry_style()
81 Vector<entry_style_span> spans; member
101 ssize_t add(const String16& value, const Vector<entry_style_span>& spans,
106 status_t addStyleSpans(size_t idx, const Vector<entry_style_span>& spans);
DStringPool.cpp129 ssize_t StringPool::add(const String16& value, const Vector<entry_style_span>& spans, in add() argument
134 addStyleSpans(res, spans); in add()
186 mEntryStyleArray[pos].spans.size() : 0; in add()
212 status_t StringPool::addStyleSpans(size_t idx, const Vector<entry_style_span>& spans) in addStyleSpans() argument
214 const size_t N=spans.size(); in addStyleSpans()
216 status_t err = addStyleSpan(idx, spans[i]); in addStyleSpans()
232 style.spans.add(span); in addStyleSpan()
336 if (style.spans.size() > 0) { in sortByConfig()
405 const size_t N = style.spans.size(); in writeStringBlock()
407 entry_style_span& span = style.spans.editItemAt(i); in writeStringBlock()
[all …]
/frameworks/base/core/java/android/view/textservice/
DTextInfo.java76 final SpellCheckSpan[] spans = spannableString.getSpans(0, spannableString.length(), in TextInfo() local
78 for (int i = 0; i < spans.length; ++i) { in TextInfo()
79 spannableString.removeSpan(spans[i]); in TextInfo()
/frameworks/base/core/java/com/android/internal/widget/
DEditableInputConnection.java179 SuggestionSpan[] spans = spanned.getSpans(0, text.length(), SuggestionSpan.class); in commitText() local
180 mIMM.registerSuggestionSpansForNotification(spans); in commitText()
/frameworks/base/core/java/com/android/internal/util/
DNotificationColorUtil.java162 Object[] spans = ss.getSpans(0, ss.length(), Object.class); in invertCharSequenceColors() local
164 for (Object span : spans) { in invertCharSequenceColors()
/frameworks/base/media/java/android/media/
DWebVttRenderer.java145 TextTrackCueSpan[] spans = new TextTrackCueSpan[mCurrentLine.size()]; in onLineEnd() local
146 mCurrentLine.toArray(spans); in onLineEnd()
148 mLines.add(spans); in onLineEnd()
484 for (TextTrackCueSpan[] spans: mLines) { in appendLinesToBuilder()
488 if (spans == null) { in appendLinesToBuilder()
494 for (TextTrackCueSpan span: spans) { in appendLinesToBuilder()
1829 public SpanLayout(Context context, TextTrackCueSpan[] spans) { in SpanLayout() argument
1832 mSpans = spans; in SpanLayout()
1839 final TextTrackCueSpan[] spans = mSpans; in update() local
1844 final int spanCount = spans.length; in update()
[all …]
/frameworks/opt/chips/tests/src/com/android/ex/chips/
DChipsTest.java649 DrawableRecipientChip[] spans = in testReplaceChip() local
651 assertEquals(spans.length, 3); in testReplaceChip()
652 spans = mEditable in testReplaceChip()
654 assertEquals((String) spans[0].getDisplay(), "replacement"); in testReplaceChip()
683 spans = mEditable.getSpans(0, mEditable.length(), DrawableRecipientChip.class); in testReplaceChip()
684 assertEquals(spans.length, 3); in testReplaceChip()
685 spans = mEditable.getSpans(firstEnd, mEditable.toString().indexOf(third) - 1, in testReplaceChip()
687 assertEquals((String) spans[0].getDisplay(), "replacement"); in testReplaceChip()
713 spans = mEditable.getSpans(0, mEditable.length(), DrawableRecipientChip.class); in testReplaceChip()
714 assertEquals(spans.length, 3); in testReplaceChip()
[all …]
/frameworks/base/core/java/com/android/internal/view/
DIInputMethodManager.aidl70 void registerSuggestionSpansForNotification(in SuggestionSpan[] spans); in registerSuggestionSpansForNotification() argument
/frameworks/base/core/java/android/widget/
DSpellChecker.java744 private <T> void removeSpansAt(Editable editable, int offset, T[] spans) { in removeSpansAt() argument
745 final int length = spans.length; in removeSpansAt()
747 final T span = spans[i]; in removeSpansAt()
DTextView.java4208 SuggestionSpan[] spans = spannable.getSpans(0, text.length(), SuggestionSpan.class); in removeSuggestionSpans() local
4209 for (int i = 0; i < spans.length; i++) { in removeSuggestionSpans()
4210 spannable.removeSpan(spans[i]); in removeSuggestionSpans()
6041 Object[] spans = spannable.getSpans(start, end, ParcelableSpan.class); in removeParcelableSpans() local
6042 int i = spans.length; in removeParcelableSpans()
6045 spannable.removeSpan(spans[i]); in removeParcelableSpans()
7643 T[] spans = text.getSpans(start, end, type); in removeIntersectingNonAdjacentSpans() local
7644 final int length = spans.length; in removeIntersectingNonAdjacentSpans()
7646 final int spanStart = text.getSpanStart(spans[i]); in removeIntersectingNonAdjacentSpans()
7647 final int spanEnd = text.getSpanEnd(spans[i]); in removeIntersectingNonAdjacentSpans()
[all …]
/frameworks/ex/common/java/com/android/ex/editstyledtext/
DEditStyledText.java878 ForegroundColorSpan[] spans = in getForegroundColor() local
880 if (spans.length > 0) { in getForegroundColor()
881 return spans[0].getForegroundColor(); in getForegroundColor()
2743 ForegroundColorSpan[] spans = in renewColor() local
2746 Log.d(LOG_TAG, "--- renewColor:" + spans.length); in renewColor()
2748 if (spans.length > 0) { in renewColor()
2749 renewColor(spans[spans.length - 1].getForegroundColor()); in renewColor()
/frameworks/base/core/java/android/view/inputmethod/
DInputMethodManager.java713 public void registerSuggestionSpansForNotification(SuggestionSpan[] spans) { in registerSuggestionSpansForNotification() argument
715 mService.registerSuggestionSpansForNotification(spans); in registerSuggestionSpansForNotification()

12