Home
last modified time | relevance | path

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

/cts/tests/tests/text/src/android/text/method/cts/
DLinkMovementMethodTest.java119 Spannable spannable = new SpannableString("test sequence"); in testOnTakeFocus() local
120 Selection.setSelection(spannable, 0, spannable.length()); in testOnTakeFocus()
122 assertSelection(spannable, 0, spannable.length()); in testOnTakeFocus()
124 2 <= spannable.getSpans(0, spannable.length(), Object.class).length); in testOnTakeFocus()
125 method.onTakeFocus(null, spannable, View.FOCUS_UP); in testOnTakeFocus()
126 assertSelection(spannable, -1); in testOnTakeFocus()
127 assertEquals(1, spannable.getSpans(0, spannable.length(), Object.class).length); in testOnTakeFocus()
128 Object span = spannable.getSpans(0, spannable.length(), Object.class)[0]; in testOnTakeFocus()
129 assertEquals(0, spannable.getSpanStart(span)); in testOnTakeFocus()
130 assertEquals(0, spannable.getSpanEnd(span)); in testOnTakeFocus()
[all …]
DTouchTest.java131 final SpannableString spannable = new SpannableString(finalText); in testOnTouchEvent() local
151 () -> mReturnFromTouchEvent = Touch.onTouchEvent(mTextView, spannable, event1)); in testOnTouchEvent()
157 assertEquals(0, Touch.getInitialScrollX(mTextView, spannable)); in testOnTouchEvent()
158 assertEquals(0, Touch.getInitialScrollY(mTextView, spannable)); in testOnTouchEvent()
162 () -> mReturnFromTouchEvent = Touch.onTouchEvent(mTextView, spannable, event2)); in testOnTouchEvent()
168 assertEquals(0, Touch.getInitialScrollX(mTextView, spannable)); in testOnTouchEvent()
169 assertEquals(0, Touch.getInitialScrollY(mTextView, spannable)); in testOnTouchEvent()
173 () -> mReturnFromTouchEvent = Touch.onTouchEvent(mTextView, spannable, event3)); in testOnTouchEvent()
179 assertEquals(-1, Touch.getInitialScrollX(mTextView, spannable)); in testOnTouchEvent()
180 assertEquals(-1, Touch.getInitialScrollY(mTextView, spannable)); in testOnTouchEvent()
DEditorState.java157 final Spannable spannable = new SpannableString(sb.toString()); in setByString() local
172 spannable.setSpan(new MockReplacementSpan(), replacementSpanStart, replacementSpanEnd, in setByString()
175 mText = Editable.Factory.getInstance().newEditable(spannable); in setByString()
DArrowKeyMovementMethodTest.java963 Spannable spannable = new SpannableString("test content"); in testInitialize() local
966 assertEquals(-1, Selection.getSelectionStart(spannable)); in testInitialize()
967 assertEquals(-1, Selection.getSelectionEnd(spannable)); in testInitialize()
968 method.initialize(null, spannable); in testInitialize()
969 assertEquals(0, Selection.getSelectionStart(spannable)); in testInitialize()
970 assertEquals(0, Selection.getSelectionEnd(spannable)); in testInitialize()
972 Selection.setSelection(spannable, 2); in testInitialize()
973 assertEquals(2, Selection.getSelectionStart(spannable)); in testInitialize()
974 assertEquals(2, Selection.getSelectionEnd(spannable)); in testInitialize()
975 method.initialize(null, spannable); in testInitialize()
[all …]
DScrollingMovementMethodTest.java599 final SpannableString spannable = new SpannableString("Test Content"); in testOnKeyUp() local
604 assertFalse(method.onKeyUp(view, spannable, KeyEvent.KEYCODE_0, event)); in testOnKeyUp()
606 assertFalse(method.onKeyUp(null, spannable, KeyEvent.KEYCODE_0, event)); in testOnKeyUp()
608 assertFalse(method.onKeyUp(view, spannable, 0, event)); in testOnKeyUp()
609 assertFalse(method.onKeyUp(view, spannable, KeyEvent.KEYCODE_0, null)); in testOnKeyUp()
/cts/tests/tests/text/src/android/text/cts/
DSpannableStringTest.java62 SpannableString spannable = SpannableString.valueOf(text); in testValueOf() local
63 assertNotNull(spannable); in testValueOf()
64 assertEquals(text, spannable.toString()); in testValueOf()
66 spannable = new SpannableString(text); in testValueOf()
67 assertSame(spannable, SpannableString.valueOf(spannable)); in testValueOf()
79 SpannableString spannable = new SpannableString(text); in testSetSpan() local
81 spannable.setSpan(null, 1, 4, SpannableString.SPAN_POINT_POINT); in testSetSpan()
82 assertEquals(1, spannable.getSpanStart(null)); in testSetSpan()
83 assertEquals(4, spannable.getSpanEnd(null)); in testSetSpan()
84 assertEquals(SpannableString.SPAN_POINT_POINT, spannable.getSpanFlags(null)); in testSetSpan()
[all …]
DSpannableStringBuilderSpanTest.java139 private void verifySpanPositions(Spannable spannable, int replaceStart, int replaceEnd, in verifySpanPositions() argument
150 int start = spannable.getSpanStart(span); in verifySpanPositions()
151 int end = spannable.getSpanEnd(span); in verifySpanPositions()
371 void initSpans(Spannable spannable, int rangeStart, int rangeEnd, int flag) { in initSpans() argument
379 mPositionSet.addPosition((rangeEnd + spannable.length()) / 2); in initSpans()
380 mPositionSet.addPosition(spannable.length()); in initSpans()
388 spannable.setSpan(mSpans[count], start, end, flag); in initSpans()
397 spannable.setSpan(mRecorder, 0, spannable.length(), Spanned.SPAN_INCLUSIVE_INCLUSIVE); in initSpans()
398 mRecorder.reset(spannable); in initSpans()
437 public void reset(Spannable spannable) { in reset() argument
[all …]
DSpannable_FactoryTest.java42 Spannable spannable = factory.newSpannable(text); in testNewSpannable() local
43 assertNotNull(spannable); in testNewSpannable()
44 assertTrue(spannable instanceof SpannableString); in testNewSpannable()
45 assertEquals(text, spannable.toString()); in testNewSpannable()
DSpannableStringBuilderTest.java851 final SpannableStringBuilder spannable = new SpannableStringBuilder(text); in testReplace_shouldNotThrowIndexOutOfBoundsExceptionForLongText() local
852 Selection.setSelection(spannable, text.length()); in testReplace_shouldNotThrowIndexOutOfBoundsExceptionForLongText()
854 spannable.replace(0, text.length(), copiedText); in testReplace_shouldNotThrowIndexOutOfBoundsExceptionForLongText()
856 assertEquals(copiedText.length(), spannable.length()); in testReplace_shouldNotThrowIndexOutOfBoundsExceptionForLongText()
DSelectionTest.java979 Spannable spannable = new SpannableStringBuilder("abcdef"); in testRemoveSelectionOnlyTriggersOneSpanRemoved() local
980 Selection.setSelection(spannable, 0, 2); in testRemoveSelectionOnlyTriggersOneSpanRemoved()
996 spannable.setSpan(watcher, 0, 2, 0); in testRemoveSelectionOnlyTriggersOneSpanRemoved()
998 Selection.removeSelection(spannable); in testRemoveSelectionOnlyTriggersOneSpanRemoved()
DStaticLayoutTest.java1238 final SpannableString spannable = new SpannableString(text);
1239 spannable.setSpan(new Object(), 0, text.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
1240 final Layout layout = StaticLayout.Builder.obtain(spannable, 0, spannable.length(),
/cts/tests/tests/text/src/android/text/util/cts/
DLinkifyTest.java108 SpannableString spannable = new SpannableString("name@gmail.com, " in testAddLinksToSpannable() local
115 assertTrue(Linkify.addLinks(spannable, Linkify.WEB_URLS)); in testAddLinksToSpannable()
116 URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); in testAddLinksToSpannable()
123 assertTrue(Linkify.addLinks(spannable, Linkify.EMAIL_ADDRESSES)); in testAddLinksToSpannable()
124 spans = spannable.getSpans(0, spannable.length(), URLSpan.class); in testAddLinksToSpannable()
148 SpannableString spannable = SpannableString.valueOf(text); in testAddLinksToTextView() local
149 tv.setText(spannable); in testAddLinksToTextView()
266 SpannableString spannable = new SpannableString(text); in testAddLinksToSpannableWithScheme() local
267 Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, "Test:"); in testAddLinksToSpannableWithScheme()
268 URLSpan[] spans = (spannable.getSpans(0, spannable.length(), URLSpan.class)); in testAddLinksToSpannableWithScheme()
[all …]
/cts/tests/tests/telephony/current/src/android/telephony/cts/
DPhoneNumberUtilsTest.java366 Spannable spannable = new SpannableString("Hello 6502223333"); in testAddPhoneTtsSpan() local
368 PhoneNumberUtils.addTtsSpan(spannable, 5, spannable.length()); in testAddPhoneTtsSpan()
370 TtsSpan[] ttsSpans = spannable.getSpans(5, spannable.length() - 1, TtsSpan.class); in testAddPhoneTtsSpan()
381 Spannable spannable = (Spannable) PhoneNumberUtils.createTtsSpannable(phoneNumber); in testGetPhoneTtsSpannable() local
383 TtsSpan[] ttsSpans = spannable.getSpans(0, spannable.length() - 1, TtsSpan.class); in testGetPhoneTtsSpannable()
/cts/tests/tests/content/src/android/content/cts/
DClipDescriptionTest.java100 SpannableString spannable = new SpannableString("Hello this is some text"); in testIsStyledText() local
101 spannable.setSpan(new UnderlineSpan(), 6, 10, 0); in testIsStyledText()
102 ClipData clipData = new ClipData(clipDescription, new ClipData.Item(spannable)); in testIsStyledText()
112 ClipData clipData2 = ClipData.newPlainText("label", spannable); in testIsStyledText()
/cts/tests/tests/widget/src/android/widget/cts/
DTextViewTest.java2529 final Spannable spannable = (Spannable)textView.getText(); in hasSpansAtMiddleOfText() local
2530 final int at = spannable.length() / 2; in hasSpansAtMiddleOfText()
2531 return spannable.getSpans(at, at, type).length > 0; in hasSpansAtMiddleOfText()
2543 final Spannable spannable = (Spannable) mTextView.getText(); in testCutAndPaste_withAndWithoutStyle() local
2544 spannable.setSpan(new URLSpan("http://example.com"), 0, spannable.length(), 0); in testCutAndPaste_withAndWithoutStyle()
4814 SpannableString spannable = new SpannableString(string); in testGetUrls() local
4815 spannable.setSpan(new URLSpan(url), 0, url.length(), 0); in testGetUrls()
4816 mTextView.setText(spannable, BufferType.SPANNABLE); in testGetUrls()
4821 spannable.setSpan(new URLSpan(email), 0, email.length(), 0); in testGetUrls()
4822 mTextView.setText(spannable, BufferType.SPANNABLE); in testGetUrls()
[all …]