Home
last modified time | relevance | path

Searched refs:spannable (Results 1 – 14 of 14) 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.java589 final SpannableString spannable = new SpannableString("Test Content"); in testOnKeyUp() local
594 assertFalse(method.onKeyUp(view, spannable, KeyEvent.KEYCODE_0, event)); in testOnKeyUp()
596 assertFalse(method.onKeyUp(null, spannable, KeyEvent.KEYCODE_0, event)); in testOnKeyUp()
598 assertFalse(method.onKeyUp(view, spannable, 0, event)); in testOnKeyUp()
599 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.java1237 final SpannableString spannable = new SpannableString(text);
1238 spannable.setSpan(new Object(), 0, text.length(), SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
1239 final Layout layout = StaticLayout.Builder.obtain(spannable, 0, spannable.length(),
/cts/tests/tests/text/src/android/text/util/cts/
DLinkifyTest.java107 SpannableString spannable = new SpannableString("name@gmail.com, " in testAddLinksToSpannable() local
114 assertTrue(Linkify.addLinks(spannable, Linkify.WEB_URLS)); in testAddLinksToSpannable()
115 URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); in testAddLinksToSpannable()
122 assertTrue(Linkify.addLinks(spannable, Linkify.EMAIL_ADDRESSES)); in testAddLinksToSpannable()
123 spans = spannable.getSpans(0, spannable.length(), URLSpan.class); in testAddLinksToSpannable()
147 SpannableString spannable = SpannableString.valueOf(text); in testAddLinksToTextView() local
148 tv.setText(spannable); in testAddLinksToTextView()
265 SpannableString spannable = new SpannableString(text); in testAddLinksToSpannableWithScheme() local
266 Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, "Test:"); in testAddLinksToSpannableWithScheme()
267 URLSpan[] spans = (spannable.getSpans(0, spannable.length(), URLSpan.class)); in testAddLinksToSpannableWithScheme()
[all …]
/cts/tests/tests/telephony/current/src/android/telephony/cts/
DPhoneNumberUtilsTest.java335 Spannable spannable = new SpannableString("Hello 6502223333"); in testAddPhoneTtsSpan() local
337 PhoneNumberUtils.addTtsSpan(spannable, 5, spannable.length()); in testAddPhoneTtsSpan()
339 TtsSpan[] ttsSpans = spannable.getSpans(5, spannable.length() - 1, TtsSpan.class); in testAddPhoneTtsSpan()
350 Spannable spannable = (Spannable) PhoneNumberUtils.createTtsSpannable(phoneNumber); in testGetPhoneTtsSpannable() local
352 TtsSpan[] ttsSpans = spannable.getSpans(0, spannable.length() - 1, TtsSpan.class); in testGetPhoneTtsSpannable()
/cts/tests/tests/widget/src/android/widget/cts/
DTextViewTest.java2406 final Spannable spannable = (Spannable)textView.getText(); in hasSpansAtMiddleOfText() local
2407 final int at = spannable.length() / 2; in hasSpansAtMiddleOfText()
2408 return spannable.getSpans(at, at, type).length > 0; in hasSpansAtMiddleOfText()
2420 final Spannable spannable = (Spannable) mTextView.getText(); in testCutAndPaste_withAndWithoutStyle() local
2421 spannable.setSpan(new URLSpan("http://example.com"), 0, spannable.length(), 0); in testCutAndPaste_withAndWithoutStyle()
4671 SpannableString spannable = new SpannableString(string); in testGetUrls() local
4672 spannable.setSpan(new URLSpan(url), 0, url.length(), 0); in testGetUrls()
4673 mTextView.setText(spannable, BufferType.SPANNABLE); in testGetUrls()
4678 spannable.setSpan(new URLSpan(email), 0, email.length(), 0); in testGetUrls()
4679 mTextView.setText(spannable, BufferType.SPANNABLE); in testGetUrls()
[all …]