Home
last modified time | relevance | path

Searched refs:span (Results 1 – 21 of 21) sorted by relevance

/cts/tests/tests/text/src/android/text/style/cts/
DQuoteSpanTest.java39 QuoteSpan span = new QuoteSpan(); in testDefaultConstructor() local
40 assertEquals(calculateLeadingMargin(span.getStripeWidth(), span.getGapWidth()), in testDefaultConstructor()
41 span.getLeadingMargin(true)); in testDefaultConstructor()
42 assertTrue(span.getColor() != 0); in testDefaultConstructor()
43 assertTrue(span.getGapWidth() > 0); in testDefaultConstructor()
44 assertTrue(span.getStripeWidth() > 0); in testDefaultConstructor()
49 QuoteSpan span = new QuoteSpan(Color.RED); in testConstructorFromColor() local
50 assertEquals(calculateLeadingMargin(span.getStripeWidth(), span.getGapWidth()), in testConstructorFromColor()
51 span.getLeadingMargin(true)); in testConstructorFromColor()
52 assertEquals(Color.RED, span.getColor()); in testConstructorFromColor()
[all …]
DSuggestionSpanTest.java61 final SuggestionSpan span = new SuggestionSpan(context, suggestions, in testConstructorWithContext() local
64 assertEquals(locale, span.getLocaleObject()); in testConstructorWithContext()
65 assertArrayEquals(suggestions, span.getSuggestions()); in testConstructorWithContext()
66 assertEquals(SuggestionSpan.FLAG_AUTO_CORRECTION, span.getFlags()); in testConstructorWithContext()
72 final SuggestionSpan span = new SuggestionSpan(Locale.forLanguageTag("en"), suggestions, in testGetSuggestionSpans() local
75 suggestions, span.getSuggestions()); in testGetSuggestionSpans()
77 final SuggestionSpan clonedSpan = cloneViaParcel(span); in testGetSuggestionSpans()
85 final SuggestionSpan span = new SuggestionSpan(Locale.forLanguageTag("en"), suggestions, in testGetSuggestionSpans_emptySuggestions() local
88 suggestions, span.getSuggestions()); in testGetSuggestionSpans_emptySuggestions()
91 final SuggestionSpan clonedSpan = cloneViaParcel(span); in testGetSuggestionSpans_emptySuggestions()
[all …]
DTextAppearanceSpanTest.java314 final TextAppearanceSpan span = new TextAppearanceSpan(mContext, in testCreateFromStyle_FontResource() local
318 span.updateDrawState(tp); in testCreateFromStyle_FontResource()
324 final TextAppearanceSpan span = new TextAppearanceSpan(mContext, in testCreateFromStyle_ElegantTextHeight() local
327 span.updateDrawState(tp); in testCreateFromStyle_ElegantTextHeight()
333 final TextAppearanceSpan span = new TextAppearanceSpan(mContext, in testCreateFromStyle_LetterSpacing() local
336 span.updateDrawState(tp); in testCreateFromStyle_LetterSpacing()
342 final TextAppearanceSpan span = new TextAppearanceSpan(mContext, in testCreateFromStyle_FontFeatureSettings() local
345 span.updateDrawState(tp); in testCreateFromStyle_FontFeatureSettings()
351 final TextAppearanceSpan span = new TextAppearanceSpan(mContext, in testCreateFromStyle_FontVariationSettings() local
354 span.updateDrawState(tp); in testCreateFromStyle_FontVariationSettings()
[all …]
DLineHeightSpan_StandardTest.java53 LineHeightSpan span = new LineHeightSpan.Standard(expectHeight); in testChooseLineHeight() local
58 span.chooseHeight("helloworld", 0, 9, 0, fm.descent - fm.ascent, fm); in testChooseLineHeight()
63 span.chooseHeight("helloworld", 0, 9, 0, fm.descent - fm.ascent, fm); in testChooseLineHeight()
72 LineHeightSpan span = new LineHeightSpan.Standard(50); in testChooseLineHeightWithNegativeOriginHeight() local
77 span.chooseHeight("helloworld", 0, 9, 0, fm.descent - fm.ascent, fm); in testChooseLineHeightWithNegativeOriginHeight()
85 LineHeightSpan.Standard span = new LineHeightSpan.Standard(height); in testGetHeight() local
87 assertEquals(height, span.getHeight()); in testGetHeight()
92 final LineHeightSpan.Standard span = new LineHeightSpan.Standard(20); in testWriteToParcel() local
94 span.writeToParcel(parcel, 0); in testWriteToParcel()
98 assertEquals(span.getHeight(), parcelSpan.getHeight()); in testWriteToParcel()
[all …]
DLineBackgroundSpan_StandardTest.java42 final LineBackgroundSpan.Standard span = new LineBackgroundSpan.Standard(COLOR); in testGetColor() local
43 assertEquals(COLOR, span.getColor()); in testGetColor()
49 final LineBackgroundSpan.Standard span = new LineBackgroundSpan.Standard(COLOR); in testWriteToParcel() local
52 span.writeToParcel(p, 0); in testWriteToParcel()
56 assertEquals(span.getSpanTypeId(), parcelSpan.getSpanTypeId()); in testWriteToParcel()
64 final LineBackgroundSpan span = new LineBackgroundSpan.Standard(COLOR); in testDrawBackground() local
75 span.drawBackground(canvas, paint, left, right, top, baseline, bottom, in testDrawBackground()
DLocaleSpanTest.java38 final LocaleSpan span = new LocaleSpan(locales); in verifyGetLocales() local
39 assertEquals(locales.get(0), span.getLocale()); in verifyGetLocales()
40 assertEquals(locales, span.getLocales()); in verifyGetLocales()
42 final LocaleSpan cloned = cloneViaParcel(span); in verifyGetLocales()
DTtsSpanTest.java65 TtsSpan span = new TtsSpan("test.type.three", mBundle); in testDescribeContents() local
66 span.describeContents(); in testDescribeContents()
71 TtsSpan span = new TtsSpan("test.type.four", mBundle); in testGetSpanTypeId() local
72 span.getSpanTypeId(); in testGetSpanTypeId()
79 TtsSpan span = new TtsSpan("test.type.five", mBundle); in testWriteAndReadParcel() local
80 span.writeToParcel(p, 0); in testWriteAndReadParcel()
/cts/tests/tests/text/src/android/text/cts/
DSpannableStringBuilderSpanTest.java147 Object span = mSpanSet.mSpans[count]; in verifySpanPositions() local
150 int start = spannable.getSpanStart(span); in verifySpanPositions()
151 int end = spannable.getSpanEnd(span); in verifySpanPositions()
171 mSpanSet.mRecorder.verifyRemoved(span, originalStart, originalEnd); in verifySpanPositions()
244 mSpanSet.mRecorder.verifyChanged(span, originalStart, originalEnd, start, end); in verifySpanPositions()
246 mSpanSet.mRecorder.verifyUnmodified(span); in verifySpanPositions()
261 Object span = mReplacementSpanSet.mSpans[count]; in verifyReplacementSpanPositions() local
264 int start = originalSpannable.getSpanStart(span); in verifyReplacementSpanPositions()
265 int end = originalSpannable.getSpanEnd(span); in verifyReplacementSpanPositions()
274 mReplacementSpanSet.mRecorder.verifyUnmodified(span); in verifyReplacementSpanPositions()
[all …]
DInputFilter_AllCapsTest.java118 final Object span = new Object(); in testFilter_greekWithSpans() local
119 source.setSpan(span, 0, 2, Spanned.SPAN_INCLUSIVE_INCLUSIVE); // around "ί" in testFilter_greekWithSpans()
131 assertSame(span, resultSpans[0]); in testFilter_greekWithSpans()
132 assertEquals(0, spannedResult.getSpanStart(span)); in testFilter_greekWithSpans()
134 assertEquals(1, spannedResult.getSpanEnd(span)); in testFilter_greekWithSpans()
135 assertEquals(Spanned.SPAN_INCLUSIVE_INCLUSIVE, spannedResult.getSpanFlags(span)); in testFilter_greekWithSpans()
DPrecomputedTextTest.java235 final BackgroundColorSpan span = new BackgroundColorSpan(Color.RED); in testSpannedInterface_Spannable() local
240 s.setSpan(span, SPAN_START, SPAN_END, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); in testSpannedInterface_Spannable()
243 assertEquals(SPAN_START, s.getSpanStart(span)); in testSpannedInterface_Spannable()
244 assertEquals(SPAN_END, s.getSpanEnd(span)); in testSpannedInterface_Spannable()
245 assertTrue((s.getSpanFlags(span) & Spanned.SPAN_INCLUSIVE_EXCLUSIVE) != 0); in testSpannedInterface_Spannable()
251 s.removeSpan(span); in testSpannedInterface_Spannable()
DSpannableStringTest.java224 final AlignmentSpan.Standard span = new AlignmentSpan.Standard( in testCopyConstructorDoesNotEnforceParagraphStyleConstraint() local
226 original.setSpan(span, 1, original.length() - 1, Spanned.SPAN_PARAGRAPH); in testCopyConstructorDoesNotEnforceParagraphStyleConstraint()
DDynamicLayoutTest.java412 final TypefaceSpan span = mock(TypefaceSpan.class); in testReflow_afterSpanChangedShouldNotThrowException() local
413 builder.setSpan(span, 1, 4, SPAN_EXCLUSIVE_EXCLUSIVE); in testReflow_afterSpanChangedShouldNotThrowException()
DSpannableStringBuilderTest.java393 final QuoteSpan span = new QuoteSpan(); in testAppend_textWithSpan() local
396 builder.append("planet", span, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in testAppend_textWithSpan()
406 assertSame("Should be the same span instance", span, spans[0]); in testAppend_textWithSpan()
DStaticLayoutTest.java1620 final FakeLineBackgroundSpan span = new FakeLineBackgroundSpan();
1621 spanStr.setSpan(span, start, end, SpannableString.SPAN_EXCLUSIVE_EXCLUSIVE);
1632 List<int[]> history = span.getHistory();
DTextUtilsTest.java308 final Object span = new Object(); in testConcat_NullParameters() local
309 piece.setSpan(span, 0, piece.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); in testConcat_NullParameters()
314 assertSame(span, spans[0]); in testConcat_NullParameters()
/cts/tests/tests/widget/src/android/widget/cts/
DDialerFilterTest.java277 Spannable span = (Spannable) mDialerFilter.getLetters(); in testSetLettersWatcher() local
278 assertEquals(-1, span.getSpanStart(mockTextWatcher)); in testSetLettersWatcher()
279 assertEquals(-1, span.getSpanEnd(mockTextWatcher)); in testSetLettersWatcher()
287 span = (Spannable) mDialerFilter.getLetters(); in testSetLettersWatcher()
288 assertEquals(0, span.getSpanStart(mockTextWatcher)); in testSetLettersWatcher()
289 assertEquals(mDialerFilter.getLetters().length(), span.getSpanEnd(mockTextWatcher)); in testSetLettersWatcher()
290 assertEquals("ANDROID", span.toString()); in testSetLettersWatcher()
312 Spannable span = (Spannable) mDialerFilter.getDigits(); in testSetDigitsWatcher() local
313 assertEquals(-1, span.getSpanStart(mockTextWatcher)); in testSetDigitsWatcher()
314 assertEquals(-1, span.getSpanEnd(mockTextWatcher)); in testSetDigitsWatcher()
[all …]
DTableRow_LayoutParamsTest.java71 assertEquals(1, layoutParams.span); in testConstructor()
79 assertEquals(1, layoutParams.span); in testConstructor()
84 assertEquals(1, layoutParams.span); in testConstructor()
88 assertEquals(1, layoutParams.span); in testConstructor()
94 assertEquals(0, layoutParams.span); in testConstructor()
100 assertEquals(0, layoutParams.span); in testConstructor()
110 assertEquals(2, layoutParams.span); in testConstructor()
DTextViewTest.java1681 ImageSpan span = new ImageSpan(drawable); in testSetTextUpdatesHeightAfterRemovingImageSpan() local
1682 text.setSpan(span, 0, 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in testSetTextUpdatesHeightAfterRemovingImageSpan()
1692 text.removeSpan(span); in testSetTextUpdatesHeightAfterRemovingImageSpan()
6275 final Object span = sourceSpans[i]; in testAllCaps_SpansArePreserved() local
6276 assertEquals(indexMap[source.getSpanStart(span)], result.getSpanStart(span)); in testAllCaps_SpansArePreserved()
6277 assertEquals(indexMap[source.getSpanEnd(span)], result.getSpanEnd(span)); in testAllCaps_SpansArePreserved()
6278 assertEquals(source.getSpanFlags(span), result.getSpanFlags(span)); in testAllCaps_SpansArePreserved()
/cts/tests/tests/text/src/android/text/method/cts/
DDialerKeyListenerTest.java52 SpannableString span = new SpannableString(""); // no meta spans in testLookup() local
57 assertEquals(keyChar, mockDialerKeyListener.lookup(keyEvent, span)); in testLookup()
67 SpannableString span = new SpannableString(""); // no meta spans in testLookupNull() local
68 mockDialerKeyListener.lookup(null, span); in testLookupNull()
DSingleLineTransformationMethodTest.java84 final AlignmentSpan.Standard span = new AlignmentSpan.Standard( in testSubsequence_doesNotThrowExceptionWithParagraphSpans() local
86 original.setSpan(span, 1, original.length() - 1, Spanned.SPAN_PARAGRAPH); in testSubsequence_doesNotThrowExceptionWithParagraphSpans()
DLinkMovementMethodTest.java128 Object span = spannable.getSpans(0, spannable.length(), Object.class)[0]; in testOnTakeFocus() local
129 assertEquals(0, spannable.getSpanStart(span)); in testOnTakeFocus()
130 assertEquals(0, spannable.getSpanEnd(span)); in testOnTakeFocus()
131 assertEquals(Spanned.SPAN_POINT_POINT, spannable.getSpanFlags(span)); in testOnTakeFocus()