/frameworks/base/core/java/android/text/style/ |
D | SpanUtils.java | 48 public static boolean toggleBold(@NonNull Spannable spannable, in toggleBold() argument 55 final StyleSpan[] boldSpans = spannable.getSpans(min, max, StyleSpan.class); in toggleBold() 63 if (!isCovered(spannable, filteredBoldSpans, min, max)) { in toggleBold() 65 spannable.setSpan( in toggleBold() 73 final int start = spannable.getSpanStart(span); in toggleBold() 74 final int end = spannable.getSpanEnd(span); in toggleBold() 75 final int flag = spannable.getSpanFlags(span); in toggleBold() 85 spannable.setSpan(span, start, min, flag); in toggleBold() 86 spannable.setSpan(new StyleSpan(span.getStyle()), max, end, flag); in toggleBold() 88 spannable.setSpan(new StyleSpan(Typeface.ITALIC), min, max, flag); in toggleBold() [all …]
|
/frameworks/base/core/tests/coretests/src/android/text/ |
D | DynamicLayoutOffsetMappingTest.java | 42 final SpannableStringBuilder spannable = new SpannableStringBuilder(text); in textWithOffsetMapping() local 43 final CharSequence transformedText = new TestOffsetMapping(spannable, 2, "\n"); in textWithOffsetMapping() 45 final DynamicLayout layout = DynamicLayout.Builder.obtain(spannable, sTextPaint, WIDTH) in textWithOffsetMapping() 58 final SpannableStringBuilder spannable = new SpannableStringBuilder(text); in textWithOffsetMapping_deletion() local 60 new TestOffsetMapping(spannable, 3, "\n\n"); in textWithOffsetMapping_deletion() 62 final DynamicLayout layout = DynamicLayout.Builder.obtain(spannable, sTextPaint, WIDTH) in textWithOffsetMapping_deletion() 69 spannable.delete(2, 3); in textWithOffsetMapping_deletion() 74 spannable.delete(2, 3); in textWithOffsetMapping_deletion() 79 spannable.delete(1, 3); in textWithOffsetMapping_deletion() 87 final SpannableStringBuilder spannable = new SpannableStringBuilder(text); in textWithOffsetMapping_insertion() local [all …]
|
D | SpannableTest.java | 41 Spannable spannable = newSpannableWithText("abcdef"); in testGetSpans() local 43 spannable.setSpan(emptySpan, 1, 1, 0); in testGetSpans() 45 spannable.setSpan(unemptySpan, 1, 2, 0); in testGetSpans() 52 spans = spannable.getSpans(0, 1, Object.class); in testGetSpans() 54 spans = spannable.getSpans(0, 2, Object.class); in testGetSpans() 56 spans = spannable.getSpans(1, 2, Object.class); in testGetSpans() 58 spans = spannable.getSpans(2, 2, Object.class); in testGetSpans() 64 Spannable spannable = newSpannableWithText("abcdef"); in testRemoveSpanWithIntermediateFlag() local 66 spannable.setSpan(emptySpan, 1, 1, 0); in testRemoveSpanWithIntermediateFlag() 68 spannable.setSpan(unemptySpan, 1, 2, 0); in testRemoveSpanWithIntermediateFlag() [all …]
|
D | DynamicLayoutTest.java | 198 final SpannableStringBuilder spannable = new SpannableStringBuilder(text); in testReflow_afterSpannableEdit() local 199 spannable.setSpan(new MockReplacementSpan(), 4, 6, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in testReflow_afterSpannableEdit() 200 spannable.setSpan(new MockReplacementSpan(), 10, length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in testReflow_afterSpannableEdit() 202 final DynamicLayout layout = new DynamicLayout(spannable, new TextPaint(), WIDTH, in testReflow_afterSpannableEdit() 205 spannable.delete(8, 9); in testReflow_afterSpannableEdit() 206 spannable.replace(7, 8, "ch"); in testReflow_afterSpannableEdit() 208 layout.reflow(spannable, 0, length, length); in testReflow_afterSpannableEdit()
|
/frameworks/base/core/tests/coretests/src/android/text/util/ |
D | LinkifyTest.java | 111 Spannable spannable = new SpannableString("any https://android.com any android.com any"); in testAddLinks_addsLinksWhenDefaultSchemeIsNull() local 112 Linkify.addLinks(spannable, Patterns.AUTOLINK_WEB_URL, null, null, null); in testAddLinks_addsLinksWhenDefaultSchemeIsNull() 114 URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); in testAddLinks_addsLinksWhenDefaultSchemeIsNull() 122 Spannable spannable = new SpannableString("any https://android.com any android.com any"); in testAddLinks_addsLinksWhenSchemesArrayIsNull() local 123 Linkify.addLinks(spannable, Patterns.AUTOLINK_WEB_URL, "http://", null, null); in testAddLinks_addsLinksWhenSchemesArrayIsNull() 125 URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); in testAddLinks_addsLinksWhenSchemesArrayIsNull() 134 Spannable spannable = new SpannableString("any android.com any"); in testAddLinks_prependsDefaultSchemeToBeginingOfLink() local 135 Linkify.addLinks(spannable, Patterns.AUTOLINK_WEB_URL, "http://", in testAddLinks_prependsDefaultSchemeToBeginingOfLink() 138 URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); in testAddLinks_prependsDefaultSchemeToBeginingOfLink() 145 Spannable spannable = new SpannableString("any https://android.com any"); in testAddLinks_doesNotPrependSchemeIfSchemeExists() local [all …]
|
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/span/ |
D | SpanHelper.java | 30 public static void replaceSpan(Spannable spannable, Object oldSpan, Object newSpan) { in replaceSpan() argument 31 final int spanStart = spannable.getSpanStart(oldSpan); in replaceSpan() 32 final int spanEnd = spannable.getSpanEnd(oldSpan); in replaceSpan() 33 spannable.removeSpan(oldSpan); in replaceSpan() 34 spannable.setSpan(newSpan, spanStart, spanEnd, 0); in replaceSpan()
|
/frameworks/base/apct-tests/perftests/core/src/android/text/ |
D | NonEditableTextGenerator.java | 68 final Spannable spannable = (mTextType == TextType.SPANNABLE_BUILDER) ? in createSpannable() local 73 spannable.setSpan(new BulletSpan(), 0, spannable.length(), SPAN_INCLUSIVE_INCLUSIVE); in createSpannable() 76 spannable.setSpan(new Object(), 0, spannable.length(), SPAN_INCLUSIVE_INCLUSIVE); in createSpannable() 77 spannable.setSpan(new Object(), 0, 1, SPAN_INCLUSIVE_INCLUSIVE); in createSpannable() 79 return spannable; in createSpannable()
|
/frameworks/opt/setupwizard/library/platform/src/com/android/setupwizardlib/view/ |
D | RichTextView.java | 66 final SpannableString spannable = new SpannableString(text); in getRichText() local 67 final Annotation[] spans = spannable.getSpans(0, spannable.length(), Annotation.class); in getRichText() 80 SpanHelper.replaceSpan(spannable, span, textAppearanceSpan); in getRichText() 83 SpanHelper.replaceSpan(spannable, span, link); in getRichText() 86 return spannable; in getRichText()
|
/frameworks/opt/setupwizard/library/gingerbread/src/com/android/setupwizardlib/view/ |
D | RichTextView.java | 66 final SpannableString spannable = new SpannableString(text); in getRichText() local 67 final Annotation[] spans = spannable.getSpans(0, spannable.length(), Annotation.class); in getRichText() 80 SpanHelper.replaceSpan(spannable, span, textAppearanceSpan); in getRichText() 83 SpanHelper.replaceSpan(spannable, span, link); in getRichText() 86 return spannable; in getRichText()
|
/frameworks/base/core/java/android/text/util/ |
D | Linkify.java | 476 SpannableString spannable = SpannableString.valueOf(text.getText()); in addLinks() local 478 boolean linksAdded = addLinks(spannable, pattern, defaultScheme, schemes, matchFilter, in addLinks() 481 text.setText(spannable); in addLinks() 517 public static final boolean addLinks(@NonNull Spannable spannable, @NonNull Pattern pattern, in addLinks() argument 520 return addLinks(spannable, pattern, scheme, null, matchFilter, in addLinks() 542 public static final boolean addLinks(@NonNull Spannable spannable, @NonNull Pattern pattern, in addLinks() argument 545 return addLinks(spannable, pattern, defaultScheme, schemes, matchFilter, transformFilter, in addLinks() 567 public static final boolean addLinks(@NonNull Spannable spannable, @NonNull Pattern pattern, in addLinks() argument 571 if (spannable != null && containsUnsupportedCharacters(spannable.toString())) { in addLinks() 590 Matcher m = pattern.matcher(spannable); in addLinks() [all …]
|
/frameworks/base/packages/SettingsLib/FooterPreference/src/com/android/settingslib/widget/ |
D | FooterPreference.java | 77 SpannableString spannable = new SpannableString(text); in linkifyTitle() local 87 final int start = spannable.getSpanStart(urlSpan); in linkifyTitle() 88 final int end = spannable.getSpanEnd(urlSpan); in linkifyTitle() 89 spannable.removeSpan(urlSpan); in linkifyTitle() 100 spannable.setSpan(clickableSpan, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in linkifyTitle() 105 title.setText(spannable); in linkifyTitle()
|
/frameworks/base/core/tests/coretests/src/android/text/method/ |
D | EditorState.java | 147 final Spannable spannable = new SpannableString(sb.toString()); in setByString() local 169 spannable.setSpan(mockReplacementSpan, replacementSpanStart, replacementSpanEnd, in setByString() 172 mText = Editable.Factory.getInstance().newEditable(spannable); in setByString()
|
/frameworks/base/core/java/android/widget/ |
D | EditText.java | 289 Spannable spannable = getText(); in performStylingAction() local 291 return SpanUtils.toggleBold(spannable, min, max); in performStylingAction() 293 return SpanUtils.toggleItalic(spannable, min, max); in performStylingAction() 295 return SpanUtils.toggleUnderline(spannable, min, max); in performStylingAction()
|
D | AutoCompleteTextView.java | 1131 Editable spannable = getText(); in replaceText() local 1132 Selection.setSelection(spannable, spannable.length()); in replaceText()
|
D | Editor.java | 1681 Spannable spannable = (Spannable) text; in downgradeEasyCorrectionSpans() local 1682 SuggestionSpan[] suggestionSpans = spannable.getSpans(0, in downgradeEasyCorrectionSpans() 1683 spannable.length(), SuggestionSpan.class); in downgradeEasyCorrectionSpans() 2664 final Spannable spannable = (Spannable) text; in shouldOfferToShowSuggestions() 2667 final SuggestionSpan[] suggestionSpans = spannable.getSpans(selectionStart, selectionEnd, in shouldOfferToShowSuggestions() 2687 final int spanStart = spannable.getSpanStart(suggestionSpans[i]); in shouldOfferToShowSuggestions() 2688 final int spanEnd = spannable.getSpanEnd(suggestionSpans[i]); in shouldOfferToShowSuggestions() 2723 Spannable spannable = (Spannable) mTextView.getText(); in isCursorInsideEasyCorrectionSpan() local 2724 SuggestionSpan[] suggestionSpans = spannable.getSpans(mTextView.getSelectionStart(), in isCursorInsideEasyCorrectionSpan() 3983 Spannable spannable = (Spannable) mTextView.getText(); in getSortedSuggestionSpans() local [all …]
|
D | TextView.java | 7063 void removeMisspelledSpans(Spannable spannable) { in removeMisspelledSpans() argument 7064 SuggestionSpan[] suggestionSpans = spannable.getSpans(0, spannable.length(), in removeMisspelledSpans() 7070 spannable.removeSpan(suggestionSpans[i]); in removeMisspelledSpans() 7708 Spannable spannable; in removeSuggestionSpans() local 7710 spannable = (Spannable) text; in removeSuggestionSpans() 7712 spannable = mSpannableFactory.newSpannable(text); in removeSuggestionSpans() 7715 SuggestionSpan[] spans = spannable.getSpans(0, text.length(), SuggestionSpan.class); in removeSuggestionSpans() 7719 text = spannable; in removeSuggestionSpans() 7723 spannable.removeSpan(spans[i]); in removeSuggestionSpans() 10153 static void removeParcelableSpans(Spannable spannable, int start, int end) { in removeParcelableSpans() argument [all …]
|
/frameworks/base/core/java/android/view/textclassifier/ |
D | TextClassifier.java | 758 final Spannable spannable = new SpannableString(string); in addLinks() local 759 if (Linkify.addLinks(spannable, linkMask(entityType))) { in addLinks() 760 final URLSpan[] spans = spannable.getSpans(0, spannable.length(), URLSpan.class); in addLinks() 763 spannable.getSpanStart(urlSpan), in addLinks() 764 spannable.getSpanEnd(urlSpan), in addLinks()
|
/frameworks/opt/chips/src/com/android/ex/chips/ |
D | RecipientEditTextView.java | 1429 Spannable spannable = getSpannable(); in sanitizeEnd() local 1434 end = spannable.getSpanEnd(mMoreChip); in sanitizeEnd() 2316 final Spannable spannable = getSpannable(); in getSortedRecipients() local 2321 int firstStart = spannable.getSpanStart(first); in getSortedRecipients() 2322 int secondStart = spannable.getSpanStart(second); in getSortedRecipients() 2445 Spannable spannable = getSpannable(); in createMoreChip() local 2456 totalReplaceStart = spannable.getSpanStart(recipients[i]); in createMoreChip() 2459 totalReplaceEnd = spannable.getSpanEnd(recipients[i]); in createMoreChip() 2462 int spanStart = spannable.getSpanStart(recipients[i]); in createMoreChip() 2463 int spanEnd = spannable.getSpanEnd(recipients[i]); in createMoreChip() [all …]
|
/frameworks/base/core/java/android/text/method/ |
D | InsertModeTransformationMethod.java | 137 final Spannable spannable = (Spannable) source; in getTransformation() local 138 spannable.setSpan(mOldTransformationMethod, 0, spannable.length(), in getTransformation()
|
/frameworks/base/core/java/android/view/accessibility/ |
D | AccessibilityNodeInfo.java | 3354 Spannable spannable = new SpannableStringBuilder(text); in replaceClickableSpan() local 3365 int spanToReplaceStart = spannable.getSpanStart(span); in replaceClickableSpan() 3366 int spanToReplaceEnd = spannable.getSpanEnd(span); in replaceClickableSpan() 3367 int spanToReplaceFlags = spannable.getSpanFlags(span); in replaceClickableSpan() 3371 spannable.removeSpan(span); in replaceClickableSpan() 3375 spannable.setSpan(replacementSpan, spanToReplaceStart, spanToReplaceEnd, in replaceClickableSpan() 3378 return spannable; in replaceClickableSpan() 3391 SpannableStringBuilder spannable = new SpannableStringBuilder(text); in replaceReplacementSpan() local 3405 int spanToReplaceStart = spannable.getSpanStart(span); in replaceReplacementSpan() 3406 int spanToReplaceEnd = spannable.getSpanEnd(span); in replaceReplacementSpan() [all …]
|
/frameworks/ex/common/java/com/android/ex/editstyledtext/ |
D | EditStyledText.java | 1774 Spannable spannable = (Spannable) txt; in dumpSpannableString() local 1775 int len = spannable.length(); in dumpSpannableString() 1777 Log.d(TAG, "--- dumpSpannableString, txt:" + spannable + ", len:" + len); in dumpSpannableString() 1779 Object[] styles = spannable.getSpans(0, len, Object.class); in dumpSpannableString() 1784 + spannable.getSpanStart(style) + "," in dumpSpannableString() 1785 + spannable.getSpanEnd(style) + "," in dumpSpannableString() 1786 + spannable.getSpanFlags(style)); in dumpSpannableString() 2509 public HorizontalLineSpan(int color, int width, Spannable spannable) { in HorizontalLineSpan() argument 2511 mDrawable = new HorizontalLineDrawable(color, width, spannable); in HorizontalLineSpan() 2703 public HorizontalLineDrawable(int color, int width, Spannable spannable) { in HorizontalLineDrawable() argument [all …]
|
/frameworks/base/media/java/android/media/ |
D | ClosedCaptionRenderer.java | 1406 Spannable spannable = (Spannable) text; in setBackgroundSpans() local 1407 Cea608CCParser.MutableBackgroundColorSpan[] bgSpans = spannable.getSpans( in setBackgroundSpans() 1408 0, spannable.length(), Cea608CCParser.MutableBackgroundColorSpan.class); in setBackgroundSpans()
|
/frameworks/base/telephony/java/android/telephony/ |
D | PhoneNumberUtils.java | 2204 Spannable spannable = Spannable.Factory.getInstance().newSpannable(phoneNumber); in createTtsSpannable() local 2205 PhoneNumberUtils.addTtsSpan(spannable, 0, spannable.length()); in createTtsSpannable() 2206 return spannable; in createTtsSpannable()
|