/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/compat/ |
D | LocaleSpanCompatUtilsTests.java | 23 import android.text.SpannableString; 24 import android.text.Spanned; 25 import android.text.style.StyleSpan; 71 final SpannableString text = new SpannableString("0123456789"); in testUpdateLocaleSpan() local 72 LocaleSpanCompatUtils.updateLocaleSpan(text, 1, 5, Locale.JAPANESE); in testUpdateLocaleSpan() 73 assertSpanCount(1, text); in testUpdateLocaleSpan() 74 assertLocaleSpan(text, 0, 1, 5, Locale.JAPANESE, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in testUpdateLocaleSpan() 79 final SpannableString text = new SpannableString("0123456789"); in testUpdateLocaleSpan() local 81 text.setSpan(styleSpan, 0, 7, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in testUpdateLocaleSpan() 82 LocaleSpanCompatUtils.updateLocaleSpan(text, 1, 5, Locale.JAPANESE); in testUpdateLocaleSpan() [all …]
|
/packages/apps/Email/tests/src/com/android/emailcommon/utility/ |
D | TextUtilitiesTests.java | 28 import android.text.SpannableStringBuilder; 29 import android.text.style.BackgroundColorSpan; 145 private void findTagEnd(String text, String tag) { in findTagEnd() argument 146 int calculatedEnd = TextUtilities.findTagEnd(text , tag, 0); in findTagEnd() 147 int knownEnd = text.indexOf('@') + 2; in findTagEnd() 201 String text = "This< should be visibl>e"; in brokentestHighlightSingleTermText() local 204 (SpannableStringBuilder)TextUtilities.highlightTermsInText(text, "Visi"); in brokentestHighlightSingleTermText() 208 assertEquals(text.indexOf("visi"), ssb.getSpanStart(span)); in brokentestHighlightSingleTermText() 209 assertEquals(text.indexOf("bl>e"), ssb.getSpanEnd(span)); in brokentestHighlightSingleTermText() 211 assertEquals(text, ssb.toString()); in brokentestHighlightSingleTermText() [all …]
|
/packages/inputmethods/LatinIME/common/src/com/android/inputmethod/latin/common/ |
D | StringUtils.java | 110 public static int codePointCount(@Nullable final CharSequence text) { in codePointCount() argument 111 if (isEmpty(text)) { in codePointCount() 114 return Character.codePointCount(text, 0, text.length()); in codePointCount() 128 public static boolean containsInArray(@Nonnull final String text, in containsInArray() argument 131 if (text.equals(element)) { in containsInArray() 146 public static boolean containsInCommaSplittableText(@Nonnull final String text, in containsInCommaSplittableText() argument 151 return containsInArray(text, extraValues.split(SEPARATOR_FOR_COMMA_SPLITTABLE_TEXT)); in containsInCommaSplittableText() 155 public static String removeFromCommaSplittableTextIfExists(@Nonnull final String text, in removeFromCommaSplittableTextIfExists() argument 161 if (!containsInArray(text, elements)) { in removeFromCommaSplittableTextIfExists() 166 if (!text.equals(element)) { in removeFromCommaSplittableTextIfExists() [all …]
|
/packages/apps/UnifiedEmail/src/com/android/emailcommon/utility/ |
D | TextUtilities.java | 22 import android.text.Spannable; 23 import android.text.SpannableString; 24 import android.text.SpannableStringBuilder; 25 import android.text.TextUtils; 26 import android.text.style.BackgroundColorSpan; 329 public static String makeSnippetFromHtmlText(String text) { in makeSnippetFromHtmlText() argument 330 return makeSnippetFromText(text, true); in makeSnippetFromHtmlText() 333 public static String makeSnippetFromPlainText(String text) { in makeSnippetFromPlainText() argument 334 return makeSnippetFromText(text, false); in makeSnippetFromPlainText() 364 public static String makeSnippetFromText(String text, boolean stripHtml) { in makeSnippetFromText() argument [all …]
|
/packages/apps/UnifiedEmail/src/org/apache/james/mime4j/codec/ |
D | EncoderUtil.java | 194 public static String encodeIfNecessary(String text, Usage usage, in encodeIfNecessary() argument 196 if (hasToBeEncoded(text, usedCharacters)) in encodeIfNecessary() 197 return encodeEncodedWord(text, usage, usedCharacters); in encodeIfNecessary() 199 return text; in encodeIfNecessary() 216 public static boolean hasToBeEncoded(String text, int usedCharacters) { in hasToBeEncoded() argument 217 if (text == null) in hasToBeEncoded() 224 for (int idx = 0; idx < text.length(); idx++) { in hasToBeEncoded() 225 char ch = text.charAt(idx); in hasToBeEncoded() 268 public static String encodeEncodedWord(String text, Usage usage) { in encodeEncodedWord() argument 269 return encodeEncodedWord(text, usage, 0, null, null); in encodeEncodedWord() [all …]
|
/packages/services/Telephony/src/org/apache/james/mime4j/codec/ |
D | EncoderUtil.java | 194 public static String encodeIfNecessary(String text, Usage usage, in encodeIfNecessary() argument 196 if (hasToBeEncoded(text, usedCharacters)) in encodeIfNecessary() 197 return encodeEncodedWord(text, usage, usedCharacters); in encodeIfNecessary() 199 return text; in encodeIfNecessary() 216 public static boolean hasToBeEncoded(String text, int usedCharacters) { in hasToBeEncoded() argument 217 if (text == null) in hasToBeEncoded() 224 for (int idx = 0; idx < text.length(); idx++) { in hasToBeEncoded() 225 char ch = text.charAt(idx); in hasToBeEncoded() 268 public static String encodeEncodedWord(String text, Usage usage) { in encodeEncodedWord() argument 269 return encodeEncodedWord(text, usage, 0, null, null); in encodeEncodedWord() [all …]
|
/packages/providers/CalendarProvider/tests/src/com/android/providers/calendar/ |
D | ICalendarTest.java | 33 String text = "BEGIN:DUMMY\n" + in testAddProperty() local 44 assertEquals(text, component.toString()); in testAddProperty() 49 String text = "BEGIN:DUMMY\n" + in testAddComponent() local 64 assertEquals(text, parent.toString()); in testAddComponent() 69 String text = "BEGIN:DUMMY\n" + in testParseBasicComponent() local 75 ICalendar.Component component = ICalendar.parseComponent(text); in testParseBasicComponent() 155 String text = "BEGIN:VEVENT\nEND:VEVENT\n"; in testParseBareEvent() local 156 ICalendar.Component event = ICalendar.parseEvent(text); in testParseBareEvent() 165 String text = "BEGIN:VEVENT\n" + in testParseEvent1() local 171 ICalendar.Component event = ICalendar.parseEvent(text); in testParseEvent1() [all …]
|
/packages/inputmethods/LatinIME/tools/make-keyboard-text/src/com/android/inputmethod/keyboard/tools/ |
D | LocaleUtils.java | 65 final String text = localeElements[INDEX_LANGUAGE]; in constructLocaleFromString() local 66 if (isValidLanguage(text)) { in constructLocaleFromString() 67 builder.setLanguage(text); in constructLocaleFromString() 73 final String text = localeElements[INDEX_SCRIPT]; in constructLocaleFromString() local 74 if (isValidScript(text)) { in constructLocaleFromString() 75 builder.setScript(text); in constructLocaleFromString() 76 } else if (isValidRegion(text)) { in constructLocaleFromString() 77 builder.setRegion(text); in constructLocaleFromString() 84 final String text = localeElements[INDEX_REGION]; in constructLocaleFromString() local 85 if (!hasRegion && isValidRegion(text)) { in constructLocaleFromString() [all …]
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/ |
D | SpannableStringUtils.java | 19 import android.text.Spannable; 20 import android.text.SpannableString; 21 import android.text.Spanned; 22 import android.text.SpannedString; 23 import android.text.TextUtils; 24 import android.text.style.SuggestionSpan; 25 import android.text.style.URLSpan; 82 public static CharSequence concatWithNonParagraphSuggestionSpansOnly(CharSequence... text) { in concatWithNonParagraphSuggestionSpansOnly() argument 83 if (text.length == 0) { in concatWithNonParagraphSuggestionSpansOnly() 87 if (text.length == 1) { in concatWithNonParagraphSuggestionSpansOnly() [all …]
|
/packages/apps/Messaging/src/com/android/messaging/datamodel/ |
D | MessageNotificationState.java | 29 import android.text.Html; 30 import android.text.Spannable; 31 import android.text.SpannableString; 32 import android.text.SpannableStringBuilder; 33 import android.text.Spanned; 34 import android.text.TextUtils; 35 import android.text.style.ForegroundColorSpan; 36 import android.text.style.StyleSpan; 37 import android.text.style.TextAppearanceSpan; 38 import android.text.style.URLSpan; [all …]
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/ |
D | RichInputConnectionAndTextRangeTests.java | 25 import android.text.SpannableString; 26 import android.text.TextUtils; 27 import android.text.style.SuggestionSpan; 68 public MockConnection(final CharSequence text, final int cursorPosition) { in MockConnection() argument 76 TextUtils.writeToParcel(text.subSequence(0, cursorPosition), p, 0 /* flags */); in MockConnection() 77 TextUtils.writeToParcel(text.subSequence(cursorPosition, text.length()), p, in MockConnection() 302 SpannableString text = new SpannableString("This is a string for test"); in helpTestGetSuggestionSpansAtWord() local 303 text.setSpan(new SuggestionSpan(Locale.ENGLISH, SUGGESTIONS1, 0 /* flags */), in helpTestGetSuggestionSpansAtWord() 305 mockInputMethodService.setInputConnection(new MockConnection(text, cursorPos)); in helpTestGetSuggestionSpansAtWord() 315 text = new SpannableString("This is a string for test"); in helpTestGetSuggestionSpansAtWord() [all …]
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/keyboard/internal/ |
D | KeyboardTextsSet.java | 21 import android.text.TextUtils; 66 private static int searchTextNameEnd(final String text, final int start) { in searchTextNameEnd() argument 67 final int size = text.length(); in searchTextNameEnd() 69 final char c = text.charAt(pos); in searchTextNameEnd() 85 String text = rawText; in resolveTextReference() local 91 " reference indirection: " + text); in resolveTextReference() 95 final int size = text.length(); in resolveTextReference() 102 final char c = text.charAt(pos); in resolveTextReference() 103 if (text.startsWith(PREFIX_TEXT, pos)) { in resolveTextReference() 105 sb = new StringBuilder(text.substring(0, pos)); in resolveTextReference() [all …]
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/suggestions/ |
D | SuggestionStripLayoutHelper.java | 31 import android.text.Spannable; 32 import android.text.SpannableString; 33 import android.text.Spanned; 34 import android.text.TextPaint; 35 import android.text.TextUtils; 36 import android.text.style.CharacterStyle; 37 import android.text.style.StyleSpan; 38 import android.text.style.UnderlineSpan; 440 final CharSequence text = getEllipsizedTextWithSettingScaleX( in layoutWord() local 443 wordView.setText(text); // TextView.setText() resets text scale x to 1.0. in layoutWord() [all …]
|
/packages/apps/UnifiedEmail/src/com/android/mail/ui/ |
D | EllipsizedMultilineTextView.java | 21 import android.text.Layout; 22 import android.text.Layout.Alignment; 23 import android.text.SpannableStringBuilder; 24 import android.text.Spanned; 25 import android.text.StaticLayout; 26 import android.text.TextUtils; 62 public CharSequence setText(final CharSequence text, int avail) { in setText() argument 63 if (text == null || text.length() == 0) { in setText() 64 return text; in setText() 68 setText(text); in setText() [all …]
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/spellcheck/ |
D | AndroidWordLevelSpellCheckerSession.java | 24 import android.text.TextUtils; 146 private static int getCheckabilityInScript(final String text, final int script) { in getCheckabilityInScript() argument 147 if (TextUtils.isEmpty(text) || text.length() <= 1) return CHECKABILITY_TOO_SHORT; in getCheckabilityInScript() 152 final int firstCodePoint = text.codePointAt(0); in getCheckabilityInScript() 158 final int length = text.length(); in getCheckabilityInScript() 160 for (int i = 0; i < length; i = text.offsetByCodePoints(i, 1)) { in getCheckabilityInScript() 161 final int codePoint = text.codePointAt(i); in getCheckabilityInScript() 192 private boolean isInDictForAnyCapitalization(final String text, final int capitalizeType) { in isInDictForAnyCapitalization() argument 195 if (mService.isValidWord(mLocale, text)) return true; in isInDictForAnyCapitalization() 201 final String lowerCaseText = text.toLowerCase(mLocale); in isInDictForAnyCapitalization() [all …]
|
/packages/apps/Settings/src/com/android/settings/widget/ |
D | LinkAccessibilityHelper.java | 21 import android.text.Layout; 22 import android.text.Spanned; 23 import android.text.style.ClickableSpan; 48 final CharSequence text = mView.getText(); in getVirtualViewAt() local 49 if (text instanceof Spanned) { in getVirtualViewAt() 50 final Spanned spannedText = (Spanned) text; in getVirtualViewAt() 63 final CharSequence text = mView.getText(); in getVisibleVirtualViews() local 64 if (text instanceof Spanned) { in getVisibleVirtualViews() 65 final Spanned spannedText = (Spanned) text; in getVisibleVirtualViews() 123 CharSequence text = mView.getText(); in getSpanForOffset() local [all …]
|
/packages/apps/ContactsCommon/src/com/android/contacts/common/format/ |
D | FormatUtils.java | 20 import android.text.SpannableString; 21 import android.text.style.StyleSpan; 107 SpannableString text = new SpannableString(input); in applyStyleToSpan() local 108 text.setSpan(new StyleSpan(style), start, end, flags); in applyStyleToSpan() 109 return text; in applyStyleToSpan() 113 public static void copyToCharArrayBuffer(String text, CharArrayBuffer buffer) { in copyToCharArrayBuffer() argument 114 if (text != null) { in copyToCharArrayBuffer() 116 if (data == null || data.length < text.length()) { in copyToCharArrayBuffer() 117 buffer.data = text.toCharArray(); in copyToCharArrayBuffer() 119 text.getChars(0, text.length(), data, 0); in copyToCharArrayBuffer() [all …]
|
D | TextHighlighter.java | 20 import android.text.SpannableString; 21 import android.text.style.CharacterStyle; 22 import android.text.style.ForegroundColorSpan; 23 import android.text.style.StyleSpan; 51 public void setPrefixText(TextView view, String text, String prefix) { in setPrefixText() argument 52 view.setText(applyPrefixHighlight(text, prefix)); in setPrefixText() 65 public void applyMaskingHighlight(SpannableString text, int start, int end) { in applyMaskingHighlight() argument 67 text.setSpan(getStyleSpan(), start, end, 0); in applyMaskingHighlight() 76 public CharSequence applyPrefixHighlight(CharSequence text, String prefix) { in applyPrefixHighlight() argument 78 return text; in applyPrefixHighlight() [all …]
|
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/ |
D | RichInputConnection.java | 23 import android.text.SpannableStringBuilder; 24 import android.text.TextUtils; 25 import android.text.style.CharacterStyle; 302 public void commitText(final CharSequence text, final int newCursorPosition) { in commitText() argument 305 mCommittedTextBeforeComposingText.append(text); in commitText() 309 mExpectedSelStart += text.length() - mComposingText.length(); in commitText() 314 mTempObjectForCommitText.append(text); in commitText() 316 0, text.length(), CharacterStyle.class); in commitText() 550 final String text = StringUtils.newSingleCodePointString(keyEvent.getUnicodeChar()); in sendKeyEvent() local 551 mCommittedTextBeforeComposingText.append(text); in sendKeyEvent() [all …]
|
/packages/apps/TV/usbtuner/src/com/android/usbtuner/cc/ |
D | CaptionWindowLayout.java | 22 import android.text.Layout.Alignment; 23 import android.text.SpannableStringBuilder; 24 import android.text.Spanned; 25 import android.text.TextUtils; 26 import android.text.style.CharacterStyle; 27 import android.text.style.RelativeSizeSpan; 28 import android.text.style.StyleSpan; 29 import android.text.style.SubscriptSpan; 30 import android.text.style.SuperscriptSpan; 31 import android.text.style.UnderlineSpan; [all …]
|
/packages/apps/Gallery2/src/com/android/gallery3d/glrenderer/ |
D | StringTexture.java | 24 import android.text.TextPaint; 25 import android.text.TextUtils; 36 private StringTexture(String text, TextPaint paint, in StringTexture() argument 39 mText = text; in StringTexture() 54 String text, float textSize, int color) { in newInstance() argument 55 return newInstance(text, getDefaultPaint(textSize, color)); in newInstance() 59 String text, float textSize, int color, in newInstance() argument 66 text = TextUtils.ellipsize( in newInstance() 67 text, paint, lengthLimit, TextUtils.TruncateAt.END).toString(); in newInstance() 69 return newInstance(text, paint); in newInstance() [all …]
|
/packages/inputmethods/OpenWnn/src/jp/co/omronsoft/openwnn/EN/ |
D | TutorialEN.java | 41 import android.text.Layout; 42 import android.text.SpannableStringBuilder; 43 import android.text.StaticLayout; 44 import android.text.Spanned; 45 import android.text.style.ImageSpan; 46 import android.text.style.DynamicDrawableSpan; 87 CharSequence text; field in TutorialEN.Bubble 97 CharSequence text = context.getResources().getText(description); in Bubble() local 98 init(context, inputView, backgroundResource, bx, by, text, guide, false); in Bubble() 113 text = new SpannableStringBuilder() in init() [all …]
|
/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/category/ |
D | IconView.java | 77 protected void computeTextPosition(String text) { in computeTextPosition() argument 78 if (text == null) { in computeTextPosition() 83 text = text.toUpperCase(); in computeTextPosition() 87 mPaint.getTextBounds(text, 0, text.length(), mTextBounds); in computeTextPosition() 97 protected void drawText(Canvas canvas, String text) { in drawText() argument 98 if (text == null) { in drawText() 101 float textWidth = mPaint.measureText(text); in drawText() 112 canvas.drawText(text, x, y, mPaint); in drawText() 115 protected void drawOutlinedText(Canvas canvas, String text) { in drawOutlinedText() argument 119 drawText(canvas, text); in drawOutlinedText() [all …]
|
/packages/apps/Settings/src/com/android/settings/ |
D | LinkifyUtils.java | 19 import android.text.Spannable; 20 import android.text.TextPaint; 21 import android.text.method.LinkMovementMethod; 22 import android.text.style.ClickableSpan; 49 public static boolean linkify(TextView textView, StringBuilder text, in linkify() argument 52 final int beginIndex = text.indexOf(PLACE_HOLDER_LINK_BEGIN); in linkify() 54 textView.setText(text); in linkify() 57 text.delete(beginIndex, beginIndex + PLACE_HOLDER_LINK_BEGIN.length()); in linkify() 58 final int endIndex = text.indexOf(PLACE_HOLDER_LINK_END); in linkify() 60 textView.setText(text); in linkify() [all …]
|
/packages/inputmethods/OpenWnn/src/jp/co/omronsoft/openwnn/JAJP/ |
D | OpenWnnEngineJAJP.java | 317 private int setSearchKey(ComposingText text, int maxLen) { in setSearchKey() argument 318 String input = text.toString(ComposingText.LAYER1); in setSearchKey() 333 mInputRomaji = text.toString(ComposingText.LAYER0); in setSearchKey() 378 public int predict(ComposingText text, int minLen, int maxLen) { in predict() argument 380 if (text == null) { return 0; } in predict() 383 int len = setSearchKey(text, maxLen); in predict() 410 public int convert(ComposingText text) { in convert() argument 413 if (text == null) { in convert() 419 int cursor = text.getCursor(ComposingText.LAYER1); in convert() 424 input = text.toString(ComposingText.LAYER1, 0, cursor - 1); in convert() [all …]
|