Code example for Spannable

Methods: getSpanscharAtlength

0
		bypass.markdownToSpannable("");
	} 
 
	public void testHeaderString() { 
		Spannable spannable = (Spannable) bypass.markdownToSpannable("Header!!\n--------");
		StyleSpan[] spans = spannable.getSpans(0, spannable.length(), StyleSpan.class);
		assertEquals(1, spans.length);
		RelativeSizeSpan[] sizeSpan = spannable.getSpans(0, spannable.length(), RelativeSizeSpan.class);
		assertEquals(1, sizeSpan.length);
		assertEquals('\n', spannable.charAt(spannable.length() - 1));
	} 
	 
	public void testBoldString() { 
		Spannable spannable = (Spannable) bypass.markdownToSpannable("One **Two** Three");
		StyleSpan[] spans = spannable.getSpans(0, spannable.length(), StyleSpan.class);
		assertEquals(1, spans.length);
		assertEquals(Typeface.BOLD, spans[0].getStyle());
		assertEquals(4, spannable.getSpanStart(spans[0]));
		assertEquals(7, spannable.getSpanEnd(spans[0]));
	} 
Stop searching for code, let great code find you!  Add Codota to your java IDE