/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/compat/ |
D | LocaleSpanCompatUtilsTests.java | 25 import android.text.SpannableString; 26 import android.text.Spanned; 27 import android.text.style.StyleSpan; 82 final SpannableString text = new SpannableString("0123456789"); in testUpdateLocaleSpan() local 83 LocaleSpanCompatUtils.updateLocaleSpan(text, 1, 5, Locale.JAPANESE); in testUpdateLocaleSpan() 84 assertSpanCount(1, text); in testUpdateLocaleSpan() 85 assertLocaleSpan(text, 0, 1, 5, Locale.JAPANESE, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in testUpdateLocaleSpan() 90 final SpannableString text = new SpannableString("0123456789"); in testUpdateLocaleSpan() local 92 text.setSpan(styleSpan, 0, 7, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); in testUpdateLocaleSpan() 93 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/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/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/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/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/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/Settings/tests/uitests/src/com/android/settings/ui/ |
D | MoreWirelessSettingsTest2.java | 157 (By.text(CONFIGURE_WIFI_PREFERENCE_TEXT)), TIMEOUT); in testWifiMenuLoadConfigure() 177 By.text(ADD_NETWORK_MENU_SAVE_BUTTON_TEXT)), TIMEOUT).isEnabled()); in testAddNetworkMenu_Default() 179 By.text(ADD_NETWORK_MENU_CANCEL_BUTTON_TEXT)), TIMEOUT).isEnabled()); in testAddNetworkMenu_Default() 221 mDevice.wait(Until.findObject(By.text("Manual")), TIMEOUT).click(); in testAddNetworkMenu_Proxy() 232 mDevice.wait(Until.findObject(By.text("Proxy Auto-Config")), TIMEOUT).click(); in testAddNetworkMenu_Proxy() 256 mDevice.wait(Until.findObject(By.text("Static")), TIMEOUT).click(); in testAddNetworkMenu_IpSettings() 284 assertNotNull(mDevice.wait(Until.findObject(By.text(PHASE2_MENU_NONE_TEXT)), TIMEOUT)); in testPhase2Settings() 285 assertNotNull(mDevice.wait(Until.findObject(By.text(PHASE2_MENU_MSCHAPV2_TEXT)), TIMEOUT)); in testPhase2Settings() 286 assertNotNull(mDevice.wait(Until.findObject(By.text(PHASE2_MENU_GTC_TEXT)), TIMEOUT)); in testPhase2Settings() 305 By.text(CACERT_MENU_PLEASE_SELECT_TEXT)), TIMEOUT)); in testCaCertSettings() [all …]
|
D | NotificationSettingsTests.java | 77 Until.findObject(By.text("Notifications")), TIMEOUT); in testNotificationsSettingsListForCalculator() 79 mDevice.wait(Until.findObject(By.text("Blink light")), TIMEOUT); in testNotificationsSettingsListForCalculator() 81 Until.findObject(By.text("On for all apps")), TIMEOUT); in testNotificationsSettingsListForCalculator() 85 Until.findObject(By.text("All apps")), TIMEOUT); in testNotificationsSettingsListForCalculator() 87 UiObject2 app = mDevice.wait(Until.findObject(By.text("Calculator")), TIMEOUT); in testNotificationsSettingsListForCalculator() 95 Until.findObject(By.text("Notifications")), TIMEOUT); in testNotificationsSettingsListForPhone() 97 mDevice.wait(Until.findObject(By.text("Blink light")), TIMEOUT); in testNotificationsSettingsListForPhone() 99 Until.findObject(By.text("On for all apps")), TIMEOUT); in testNotificationsSettingsListForPhone() 103 Until.findObject(By.text("All apps")), TIMEOUT); in testNotificationsSettingsListForPhone() 109 UiObject2 phone = scrollTo(mDevice, apps, By.text("Phone"), Direction.DOWN); in testNotificationsSettingsListForPhone() [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/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/apps/Traceur/uitests/src/com/android/settings/ui/ |
D | TraceurAppTests.java | 89 mDevice.wait(Until.findObject(By.text("Record trace")), in testElementsOnMainScreen() 92 mDevice.wait(Until.findObject(By.text("Trace debuggable applications")), in testElementsOnMainScreen() 95 mDevice.wait(Until.findObject(By.text("Categories")), in testElementsOnMainScreen() 98 mDevice.wait(Until.findObject(By.text("Restore default categories")), in testElementsOnMainScreen() 101 mDevice.wait(Until.findObject(By.text("Per-CPU buffer size")), in testElementsOnMainScreen() 104 mDevice.wait(Until.findObject(By.text("Clear saved traces")), in testElementsOnMainScreen() 107 mDevice.wait(Until.findObject(By.text("Long traces")), in testElementsOnMainScreen() 110 mDevice.wait(Until.findObject(By.text("Maximum long trace size")), in testElementsOnMainScreen() 113 mDevice.wait(Until.findObject(By.text("Maximum long trace duration")), in testElementsOnMainScreen() 116 mDevice.wait(Until.findObject(By.text("Show Quick Settings tile")), in testElementsOnMainScreen() [all …]
|
/packages/apps/Contacts/src/com/android/contacts/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 | 19 import android.text.SpannableString; 20 import android.text.style.CharacterStyle; 21 import android.text.style.StyleSpan; 47 public void setPrefixText(TextView view, String text, String prefix) { in setPrefixText() argument 48 view.setText(applyPrefixHighlight(text, prefix)); in setPrefixText() 61 public void applyMaskingHighlight(SpannableString text, int start, int end) { in applyMaskingHighlight() argument 63 text.setSpan(getStyleSpan(), start, end, 0); in applyMaskingHighlight() 72 public CharSequence applyPrefixHighlight(CharSequence text, String prefix) { in applyPrefixHighlight() argument 74 return text; in applyPrefixHighlight() 85 int index = FormatUtils.indexOfWordPrefix(text, trimmedPrefix); in applyPrefixHighlight() [all …]
|
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/ |
D | RichInputConnectionAndTextRangeTests.java | 26 import android.text.SpannableString; 27 import android.text.TextUtils; 28 import android.text.style.SuggestionSpan; 77 public MockConnection(final CharSequence text, final int cursorPosition) { in MockConnection() argument 85 TextUtils.writeToParcel(text.subSequence(0, cursorPosition), p, 0 /* flags */); in MockConnection() 86 TextUtils.writeToParcel(text.subSequence(cursorPosition, text.length()), p, in MockConnection() 314 SpannableString text = new SpannableString("This is a string for test"); in helpTestGetSuggestionSpansAtWord() local 315 text.setSpan(new SuggestionSpan(Locale.ENGLISH, SUGGESTIONS1, 0 /* flags */), in helpTestGetSuggestionSpansAtWord() 317 mockInputMethodService.setInputConnection(new MockConnection(text, cursorPos)); in helpTestGetSuggestionSpansAtWord() 327 text = new SpannableString("This is a string for test"); in helpTestGetSuggestionSpansAtWord() [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/TV/tests/func/src/com/android/tv/tests/ui/dvr/ |
D | DvrLibraryTest.java | 58 ByResource.text(controller.getTargetResources(), R.string.dvr_main_recent)); in setUp() 61 ByResource.text( in setUp() 65 ByResource.text(controller.getTargetResources(), R.string.dvr_main_series)); in setUp() 69 ByResource.text( in setUp() 109 ByResource.text( in testEmptyLibrary() 131 By.text( in testScheduleRecordings() 142 By.text( in testScheduleRecordings() 162 ByResource.text( in testScheduleRecordings() 168 ByResource.text( in testScheduleRecordings() 196 ByResource.text( in testScheduleRecordings() [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/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/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/apps/Dialer/java/com/android/dialer/i18n/ |
D | DialerBidiFormatter.java | 21 import android.text.SpannableStringBuilder; 22 import android.text.SpannedString; 23 import android.text.TextUtils; 54 public static CharSequence format(@Nullable CharSequence text) { in format() argument 55 if (TextUtils.isEmpty(text)) { in format() 56 return text; in format() 62 Matcher matcher = Patterns.PHONE.matcher(text.toString()); in format() 71 spannableStringBuilder.append(text.subSequence(currIndex, start)); in format() 79 String.valueOf(LRE), text.subSequence(start, end), String.valueOf(PDF)))); in format() 85 if (currIndex < text.length()) { in format() [all …]
|
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/ |
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/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/LatinIME/tools/EditTextVariations/src/com/android/inputmethod/tools/edittextvariations/ |
D | EditTextVariations.java | 31 import android.text.InputType; 32 import android.text.TextUtils; 223 String text; in setupHintText() local 225 text = "actionLabel<" + e.getImeActionLabel() + ":" + e.getImeActionId() + ">"; in setupHintText() 227 text = actionName(imeOptions & EditorInfo.IME_MASK_ACTION); in setupHintText() 229 text = appendFlagText(text, in setupHintText() 231 text = appendFlagText(text, in setupHintText() 233 text = appendFlagText(text, in setupHintText() 235 text = appendFlagText(text, in setupHintText() 237 text = appendFlagText(text, in setupHintText() [all …]
|