Home
last modified time | relevance | path

Searched refs:spannable (Results 1 – 10 of 10) sorted by relevance

/cts/tests/tests/text/src/android/text/cts/
DSpannableStringTest.java37 SpannableString spannable = SpannableString.valueOf(text); in testValueOf() local
38 assertNotNull(spannable); in testValueOf()
39 assertEquals(text, spannable.toString()); in testValueOf()
41 spannable = new SpannableString(text); in testValueOf()
42 assertSame(spannable, SpannableString.valueOf(spannable)); in testValueOf()
53 SpannableString spannable = new SpannableString(text); in testSetSpan() local
55 spannable.setSpan(null, 1, 4, SpannableString.SPAN_POINT_POINT); in testSetSpan()
56 assertEquals(1, spannable.getSpanStart(null)); in testSetSpan()
57 assertEquals(4, spannable.getSpanEnd(null)); in testSetSpan()
58 assertEquals(SpannableString.SPAN_POINT_POINT, spannable.getSpanFlags(null)); in testSetSpan()
[all …]
DSpannable_FactoryTest.java30 Spannable spannable = factory.newSpannable(text); in testNewSpannable() local
31 assertNotNull(spannable); in testNewSpannable()
32 assertTrue(spannable instanceof SpannableString); in testNewSpannable()
33 assertEquals(text, spannable.toString()); in testNewSpannable()
DSpannableStringBuilderSpanTest.java120 private void checkSpanPositions(Spannable spannable, int replaceStart, int replaceEnd, in checkSpanPositions() argument
131 int start = spannable.getSpanStart(span); in checkSpanPositions()
132 int end = spannable.getSpanEnd(span); in checkSpanPositions()
352 void initSpans(Spannable spannable, int rangeStart, int rangeEnd, int flag) { in initSpans() argument
360 mPositionSet.addPosition((rangeEnd + spannable.length()) / 2); in initSpans()
361 mPositionSet.addPosition(spannable.length()); in initSpans()
369 spannable.setSpan(mSpans[count], start, end, flag); in initSpans()
378 spannable.setSpan(mRecorder, 0, spannable.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); in initSpans()
379 mRecorder.reset(spannable); in initSpans()
418 public void reset(Spannable spannable) { in reset() argument
[all …]
/cts/tests/tests/text/src/android/text/method/cts/
DLinkMovementMethodTest.java99 Spannable spannable = new SpannableString("test sequence"); in testOnTakeFocus() local
100 Selection.setSelection(spannable, 0, spannable.length()); in testOnTakeFocus()
102 assertSelection(spannable, 0, spannable.length()); in testOnTakeFocus()
103 …assertTrue("Expected at least 2 spans", 2 <= spannable.getSpans(0, spannable.length(), Object.clas… in testOnTakeFocus()
104 method.onTakeFocus(null, spannable, View.FOCUS_UP); in testOnTakeFocus()
105 assertSelection(spannable, -1); in testOnTakeFocus()
106 assertEquals(1, spannable.getSpans(0, spannable.length(), Object.class).length); in testOnTakeFocus()
107 Object span = spannable.getSpans(0, spannable.length(), Object.class)[0]; in testOnTakeFocus()
108 assertEquals(0, spannable.getSpanStart(span)); in testOnTakeFocus()
109 assertEquals(0, spannable.getSpanEnd(span)); in testOnTakeFocus()
[all …]
DTouchTest.java125 final SpannableString spannable = new SpannableString(finalText); in testOnTouchEvent() local
148 mReturnFromTouchEvent = Touch.onTouchEvent(tv, spannable, event1); in testOnTouchEvent()
156 assertEquals(0, Touch.getInitialScrollX(tv, spannable)); in testOnTouchEvent()
157 assertEquals(0, Touch.getInitialScrollY(tv, spannable)); in testOnTouchEvent()
162 mReturnFromTouchEvent = Touch.onTouchEvent(tv, spannable, event2); in testOnTouchEvent()
170 assertEquals(0, Touch.getInitialScrollX(tv, spannable)); in testOnTouchEvent()
171 assertEquals(0, Touch.getInitialScrollY(tv, spannable)); in testOnTouchEvent()
176 mReturnFromTouchEvent = Touch.onTouchEvent(tv, spannable, event3); in testOnTouchEvent()
184 assertEquals(-1, Touch.getInitialScrollX(tv, spannable)); in testOnTouchEvent()
185 assertEquals(-1, Touch.getInitialScrollY(tv, spannable)); in testOnTouchEvent()
DArrowKeyMovementMethodTest.java662 Spannable spannable = new SpannableString("test content"); in testInitialize() local
665 assertEquals(-1, Selection.getSelectionStart(spannable)); in testInitialize()
666 assertEquals(-1, Selection.getSelectionEnd(spannable)); in testInitialize()
667 method.initialize(null, spannable); in testInitialize()
668 assertEquals(0, Selection.getSelectionStart(spannable)); in testInitialize()
669 assertEquals(0, Selection.getSelectionEnd(spannable)); in testInitialize()
671 Selection.setSelection(spannable, 2); in testInitialize()
672 assertEquals(2, Selection.getSelectionStart(spannable)); in testInitialize()
673 assertEquals(2, Selection.getSelectionEnd(spannable)); in testInitialize()
674 method.initialize(null, spannable); in testInitialize()
[all …]
DScrollingMovementMethodTest.java651 SpannableString spannable = new SpannableString("Test Content");
655 assertFalse(method.onKeyUp(view, spannable, KeyEvent.KEYCODE_0, event));
657 assertFalse(method.onKeyUp(null, spannable, KeyEvent.KEYCODE_0, event));
659 assertFalse(method.onKeyUp(view, spannable, 0, event));
660 assertFalse(method.onKeyUp(view, spannable, KeyEvent.KEYCODE_0, null));
/cts/tests/tests/text/src/android/text/util/cts/
DLinkifyTest.java82 SpannableString spannable = new SpannableString("name@gmail.com, " in testAddLinks1() local
89 assertTrue(Linkify.addLinks(spannable, Linkify.WEB_URLS)); in testAddLinks1()
90 URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); in testAddLinks1()
97 assertTrue(Linkify.addLinks(spannable, Linkify.EMAIL_ADDRESSES)); in testAddLinks1()
98 spans = spannable.getSpans(0, spannable.length(), URLSpan.class); in testAddLinks1()
122 SpannableString spannable = SpannableString.valueOf(text); in testAddLinks2() local
123 tv.setText(spannable); in testAddLinks2()
236 SpannableString spannable = new SpannableString(text); in testAddLinks5() local
237 Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, "Test:"); in testAddLinks5()
238 URLSpan[] spans = (spannable.getSpans(0, spannable.length(), URLSpan.class)); in testAddLinks5()
[all …]
/cts/tests/tests/telephony/src/android/telephony/cts/
DPhoneNumberUtilsTest.java346 Spannable spannable = new SpannableString("Hello 6502223333"); in testAddPhoneTtsSpan() local
348 PhoneNumberUtils.addTtsSpan(spannable, 5, spannable.length()); in testAddPhoneTtsSpan()
350 TtsSpan[] ttsSpans = spannable.getSpans(5, spannable.length() - 1, TtsSpan.class); in testAddPhoneTtsSpan()
360 Spannable spannable = (Spannable) PhoneNumberUtils.createTtsSpannable(phoneNumber); in testGetPhoneTtsSpannable() local
362 TtsSpan[] ttsSpans = spannable.getSpans(0, spannable.length() - 1, TtsSpan.class); in testGetPhoneTtsSpannable()
/cts/tests/tests/widget/src/android/widget/cts/
DTextViewTest.java1727 final Spannable spannable = (Spannable)textView.getText(); in hasSpansAtMiddleOfText() local
1728 final int at = spannable.length() / 2; in hasSpansAtMiddleOfText()
1729 return spannable.getSpans(at, at, type).length > 0; in hasSpansAtMiddleOfText()
1740 final Spannable spannable = (Spannable) mTextView.getText(); in testCutAndPaste_withAndWithoutStyle()
1741 spannable.setSpan(new URLSpan("http://example.com"), 0, spannable.length(), 0); in testCutAndPaste_withAndWithoutStyle()
1783 final Spannable spannable = new SpannableString(text); in testSaveInstanceStateSelection() local
1784 originalTextView.setText(spannable); in testSaveInstanceStateSelection()
2916 SpannableString spannable = new SpannableString(string); in testGetUrls() local
2917 spannable.setSpan(new URLSpan(url), 0, url.length(), 0); in testGetUrls()
2918 mTextView.setText(spannable, BufferType.SPANNABLE); in testGetUrls()
[all …]