Best code examples for Android Spanned class (android.text.Spanned)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android Spanned class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android Spanned examples from Open Source projects
This code example shows how to use the following methods: removeSpan, setSpan, getSpanEnd, getSpanStart, getSpans
94:	URLSpan[] link = buffer.getSpans(off, off, URLSpan.class); 
-
102:	buffer.removeSpan(mLinkFocusStyle); 
-
105:	buffer.setSpan(mLinkFocusStyle, 
106:	buffer.getSpanStart(link[0]), 
107:	buffer.getSpanEnd(link[0]), 
-
116:	buffer.removeSpan(mLinkFocusStyle); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: removeSpan, setSpan, getSpanStart, length
260:	int length = output.length(); 
-
262:	int start = output.getSpanStart(span); 
263:	output.removeSpan(span); 
-
265:	output.setSpan(span, start, length, SPAN_EXCLUSIVE_EXCLUSIVE); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: length, subSequence
408:	String result = String.valueOf(dest.subSequence(0, dstart)) 
409:	+ filtered + dest.subSequence(dend, dest.length()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getSpans, charAt, length
37:	StyleSpan[] spans = spannable.getSpans(0, spannable.length(), StyleSpan.class); 
-
39:	RelativeSizeSpan[] sizeSpan = spannable.getSpans(0, spannable.length(), RelativeSizeSpan.class); 
-
41:	assertEquals('\n', spannable.charAt(spannable.length() - 1)); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getSpans
178:	SuggestionSpan[] spans = spanned.getSpans(0, text.length(), SuggestionSpan.class); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: removeSelection, setSelection, getSpanEnd, getSpanStart, getSpans
212:	MyURLSpan[] link = buffer.getSpans(off, off, MyURLSpan.class); 
-
226:	Selection.setSelection(buffer, 
227:	buffer.getSpanStart(link[0]), 
228:	buffer.getSpanEnd(link[0])); 
-
233:	Selection.removeSelection(buffer); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getSpans, length, toString
99:	assertEquals("01234", ret.toString()); 
-
104:	ImageSpan[] imageSpans = ret.getSpans(0, ret.length(), ImageSpan.class); 
-
110:	QuoteSpan[] quoteSpans = ret.getSpans(0, ret.length(), QuoteSpan.class); 
-
115:	CustomSpan[] customSpans = ret.getSpans(0, ret.length(), CustomSpan.class); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setSelection, getSpanEnd, getSpanStart, getSpans
47:	ClickableSpan[] link = buffer.getSpans(off, off, ClickableSpan.class); 
-
53:	Selection.setSelection(buffer, buffer.getSpanStart(link[0]), buffer.getSpanEnd(link[0])); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: getSpans, length, toString
99:	assertEquals("01234", ret.toString()); 
-
104:	ImageSpan[] imageSpans = ret.getSpans(0, ret.length(), ImageSpan.class); 
-
110:	QuoteSpan[] quoteSpans = ret.getSpans(0, ret.length(), QuoteSpan.class); 
-
115:	CustomSpan[] customSpans = ret.getSpans(0, ret.length(), CustomSpan.class); 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: setSelection, getSpanEnd, getSpanStart, getSpans
254:	ClickableSpan[] link = buffer.getSpans(off, off, 
-
262:	Selection.setSelection(buffer, 
263:	buffer.getSpanStart(link[0]), 
264:	buffer.getSpanEnd(link[0])); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getSpans
48:	ClickableSpan[] links = buffer.getSpans(off, off, 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: removeSpan, setSpan, getSpanFlags
232:	int state = content.getSpanFlags(what); 
-
237:	content.setSpan(what, 0, 0, LOCKED); 
-
241:	content.removeSpan(what); 
-
243:	content.setSpan(what, 0, 0, PRESSED); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setSelection, getSpanEnd, getSpanStart, getSpans
48:	ClickableSpan[] link = buffer.getSpans(off, off, 
-
55:	Selection.setSelection(buffer, 
56:	buffer.getSpanStart(link[0]), 
57:	buffer.getSpanEnd(link[0])); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: removeSpan, setSpan, getSpanEnd, getSpanStart, getSpans
83:	URLSpan[] link = buffer.getSpans(off, off, URLSpan.class); 
-
91:	buffer.removeSpan(mClickedColorStyle); 
-
94:	buffer.setSpan(mClickedColorStyle, buffer.getSpanStart(link[0]), buffer 
95:	.getSpanEnd(link[0]), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); 
-
103:	buffer.removeSpan(mClickedColorStyle); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: removeSpan, setSpan, getSpanEnd, getSpanStart, getSpans
83:	URLSpan[] link = buffer.getSpans(off, off, URLSpan.class); 
-
91:	buffer.removeSpan(mClickedColorStyle); 
-
94:	buffer.setSpan(mClickedColorStyle, buffer.getSpanStart(link[0]), buffer 
95:	.getSpanEnd(link[0]), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); 
-
103:	buffer.removeSpan(mClickedColorStyle); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: length, subSequence
390:	String result = String.valueOf(dest.subSequence(0, dstart)) 
391:	+ filtered + dest.subSequence(dend, dest.length()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getSpans
178:	SuggestionSpan[] spans = spanned.getSpans(0, text.length(), SuggestionSpan.class); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setSelection, getSpanEnd, getSpanStart, getSpans
50:	ClickableSpan[] link = buffer.getSpans(off, off, ClickableSpan.class); 
-
57:	Selection.setSelection(buffer, buffer.getSpanStart(link[0]), buffer.getSpanEnd(link[0])); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setSpan, getSpans
16:	spannable.setSpan(emptySpan, 1, 1, 0); 
-
18:	spannable.setSpan(unemptySpan, 1, 2, 0); 
-
25:	spans = spannable.getSpans(0, 1, Object.class); 
-
27:	spans = spannable.getSpans(0, 2, Object.class); 
-
29:	spans = spannable.getSpans(1, 2, Object.class); 
-
31:	spans = spannable.getSpans(2, 2, Object.class); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getSpans, length
29:	return(str.getSpans(0, str.length() - 1, StyleSpan.class)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: removeSelection, setSelection, getSpanEnd, getSpanStart, getSpans
93:	ClickableSpan[] link = buffer.getSpans(off, off, 
-
100:	Selection.setSelection(buffer, 
101:	buffer.getSpanStart(link[0]), 
102:	buffer.getSpanEnd(link[0])); 
-
110:	Selection.removeSelection(buffer); 
111:	Touch.onTouchEvent(widget, buffer, event); 
-
115:	return Touch.onTouchEvent(widget, buffer, event); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setSelection, getSpanEnd, getSpanStart, getSpans
57:	ClickableSpan[] link = buffer.getSpans(off, off, 
-
64:	Selection.setSelection(buffer, 
65:	buffer.getSpanStart(link[0]), 
66:	buffer.getSpanEnd(link[0])); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: setSelection, getSpanEnd, getSpanStart, getSpans
50:	Object [] spans = buffer.getSpans(off, off, spanClass); 
-
53:	Selection.setSelection(buffer, 
54:	buffer.getSpanStart(spans[0]), 
55:	buffer.getSpanEnd(spans[0])); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getSpanEnd, getSpanStart, getSpans, length, toString
90:	assertEquals("10 minutes  (Inbound to Van Ness)", text.toString()); 
91:	Object styles[] = text.getSpans(0, text.length(), Object.class); 
-
95:	assertEquals("10 minutes".length(), text.getSpanStart(span)); 
96:	assertEquals(text.length(), text.getSpanEnd(span)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: subSequence
371:	String result = String.valueOf(dest.subSequence(0, dstart)) 
-
373:	+ dest.subSequence(dend, dest.length()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: removeSpan, setSpan, getSpanEnd, getSpanStart, getSpans
60:	URLSpan[] link = buffer.getSpans(off, off, URLSpan.class); 
-
68:	buffer.removeSpan(mLinkFocusStyle); 
-
71:	buffer.setSpan(mLinkFocusStyle, buffer.getSpanStart(link[0]), buffer 
72:	.getSpanEnd(link[0]), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE); 
-
80:	buffer.removeSpan(mLinkFocusStyle); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: removeSpan, setSpan, getSpanStart, length
260:	int length = output.length(); 
-
262:	int start = output.getSpanStart(span); 
263:	output.removeSpan(span); 
-
265:	output.setSpan(span, start, length, SPAN_EXCLUSIVE_EXCLUSIVE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: length, subSequence
23:	String destPrefix = dest.subSequence(0, dstart).toString(); 
24:	String destSuffix = dest.subSequence(dend, dest.length()).toString(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setSelection, getSpanEnd, getSpanStart, getSpans
52:	URLSpan[] link = buffer.getSpans(off, off, URLSpan.class); 
-
58:	Selection.setSelection(buffer, 
59:	buffer.getSpanStart(link[0]), 
60:	buffer.getSpanEnd(link[0])); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: removeSelection, setSelection, getSpanEnd, getSpanStart, getSpans
197:	ClickableSpan[] link = buffer.getSpans(off, off, ClickableSpan.class); 
-
203:	Selection.setSelection(buffer, 
204:	buffer.getSpanStart(link[0]), 
205:	buffer.getSpanEnd(link[0])); 
-
210:	Selection.removeSelection(buffer); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: removeSelection, setSelection, getSpanEnd, getSpanStart, getSpans
32:	TouchableSpan[] link = buffer.getSpans(off, off, TouchableSpan.class); 
-
39:	Selection.setSelection(buffer, 
40:	buffer.getSpanStart(link[0]), 
41:	buffer.getSpanEnd(link[0])); 
-
46:	Selection.removeSelection(buffer); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: setSelection, getSpanEnd, getSpanStart, getSpans
40:	ClickableSpan[] link = s.getSpans(off, off, 
-
47:	Selection.setSelection(s, 
48:	s.getSpanStart(link[0]), 
49:	s.getSpanEnd(link[0])); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getSelectionEnd, getSpanEnd, getSpanStart, length, subSequence
475:	int suggestedStart = s.getSpanStart(mSuggested); 
476:	int suggestedEnd = s.getSpanEnd(mSuggested); 
477:	int cursorPos = Selection.getSelectionEnd(s); 
-
479:	suggestedStart = suggestedEnd = s.length(); 
-
482:	Log.d(TAG, "checkInvariant all='" + s + "' (len " + s.length() + ") sug=" 
-
487:	s.length(), userEntered.length() + suggestedLen); 
-
492:	s.subSequence(0, suggestedStart).toString())); 
493:	if (mSuggestedText != null && suggestedStart < s.length()) { 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: removeSelection, setSelection, getSpanEnd, getSpanStart, getSpans
216:	MyURLSpan[] link = buffer.getSpans(off, off, MyURLSpan.class); 
-
230:	Selection.setSelection(buffer, 
231:	buffer.getSpanStart(link[0]), 
232:	buffer.getSpanEnd(link[0])); 
-
237:	Selection.removeSelection(buffer); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setSelection, getSpanEnd, getSpanStart, getSpans
47:	ClickableSpan[] link = buffer.getSpans(off, off, ClickableSpan.class); 
-
53:	Selection.setSelection(buffer, buffer.getSpanStart(link[0]), buffer.getSpanEnd(link[0])); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: length, subSequence
191:	String checkedText = dest.subSequence(0, dstart).toString() + 
-
193:	dest.subSequence(dend,dest.length()).toString(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: length, subSequence
16:	int keep = 5 - (dest.length() - (dend - dstart)); 
-
25:	String fin = dest.subSequence(0, dstart).toString() + sub.toString() + dest.subSequence(dend, dest.length()).toString(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setSelection, getSpanEnd, getSpanStart, getSpans
58:	final ClickableSpan[] link = buffer.getSpans(off, off, 
-
64:	Selection.setSelection(buffer, 
65:	buffer.getSpanStart(link[0]), 
66:	buffer.getSpanEnd(link[0])); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: length, subSequence
18:	String textToCheck = destination.subSequence(0, destinationStart).toString() + source.subSequence(sourceStart, sourceEnd) 
19:	+ destination.subSequence(destinationEnd, destination.length()).toString(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: length, subSequence
28:	String checkedText = dest.subSequence(0, dstart).toString() + 
-
30:	dest.subSequence(dend,dest.length()).toString(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: subSequence
379:	String result = String.valueOf(dest.subSequence(0, dstart)) 
-
381:	+ dest.subSequence(dend, dest.length()); 
Full Snippet Info
5
CodeRank
Related Android Spanned Questions & Answers:
See Code Examples for Android Spanned Methods: