Searched refs:spans (Results 1 - 16 of 16) sorted by relevance

/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/latin/utils/
H A DTextRange.java48 * Gets the suggestion spans that are put squarely on the word, with the exact start
50 * @return the list of spans.
59 // spans were cut at the cursor position, and #getSpans(start, end) does not return
60 // spans that end at `start' or begin at `end'. Consider the following case:
68 // the 4~7 spans and we can merge them accordingly.
74 final SuggestionSpan[] spans = text.getSpans(mWordAtCursorStartIndex - 1,
78 for (; readIndex < spans.length; ++readIndex) {
79 final SuggestionSpan span = spans[readIndex];
87 for (int i = readIndex + 1; i < spans.length; ++i) {
88 if (span.equals(spans[
[all...]
H A DSpannableStringUtils.java28 * Copies the spans from the region <code>start...end</code> in
39 * @throws IndexOutOfBoundsException if any of the copied spans
44 Object[] spans = source.getSpans(start, end, SuggestionSpan.class);
46 for (int i = 0; i < spans.length; i++) {
47 int fl = source.getSpanFlags(spans[i]);
50 int st = source.getSpanStart(spans[i]);
51 int en = source.getSpanEnd(spans[i]);
58 dest.setSpan(spans[i], st - start + destoff, en - start + destoff,
65 * SuggestionSpans that don't have the PARAGRAPH flag, but not other spans.
/packages/apps/Email/tests/src/com/android/emailcommon/utility/
H A DTextUtilitiesTests.java202 BackgroundColorSpan[] spans = ssb.getSpans(0, ssb.length(), BackgroundColorSpan.class);
203 assertEquals(1, spans.length);
204 BackgroundColorSpan span = spans[0];
213 spans = ssb.getSpans(0, ssb.length(), BackgroundColorSpan.class);
214 assertEquals(2, spans.length);
215 span = spans[0];
218 span = spans[1];
229 BackgroundColorSpan[] spans = ssb.getSpans(0, ssb.length(), BackgroundColorSpan.class);
230 assertEquals(2, spans.length);
231 BackgroundColorSpan span = spans[
[all...]
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/utils/
H A DSpannableStringUtilsTests.java50 Object[] spans = result.getSpans(0, result.length(), SuggestionSpan.class);
51 for (int i = 0; i < spans.length; i++) {
52 final int flags = result.getSpanFlags(spans[i]);
55 assertTrue("Should be a SuggestionSpan", spans[i] instanceof SuggestionSpan);
/packages/apps/QuickSearchBox/src/com/android/quicksearchbox/
H A DSuggestionFormatter.java52 private void setSpans(Spannable text, int start, int end, Object[] spans) { argument
53 for (Object span : spans) {
/packages/apps/UnifiedEmail/src/com/android/mail/ui/
H A DEllipsizedMultilineTextView.java86 // assemble just the text portion, without spans
95 // Now copy the original spans into the assembled string, modified for any ellipsizing.
98 // spans in the assembled version if a CharacterStyle spanned across the lastLineStart
102 final Object[] spans = s.getSpans(0, s.length(), Object.class);
104 for (int i = 0; i < spans.length; i++) {
105 final Object span = spans[i];
/packages/apps/QuickSearchBox/tests/src/com/android/quicksearchbox/
H A DLevenshteinFormatterTest.java151 private void verifyFormatSuggestion(String query, String suggestion, SpanFormat... spans) { argument
153 for (SpanFormat span : spans) {
353 MockStyleSpan[] spans = spanned.getSpans(mStart, mEnd, MockStyleSpan.class);
354 assertEquals("Wrong number of spans in '" + spannedText + "'", 1, spans.length);
356 mStyle, spans[0].getId());
/packages/inputmethods/LatinIME/tests/src/com/android/inputmethod/latin/
H A DInputTestsBase.java70 final CharacterStyle[] spans =
72 if (0 == spans.length) {
76 } else if (1 == spans.length) {
77 mSpan = spans[0];
81 throw new RuntimeException("Expected one span, found " + spans.length);
/packages/apps/UnifiedEmail/src/com/android/mail/widget/
H A DWidgetService.java469 CharacterStyle[] spans = sender.getSpans(0, sender.length(), CharacterStyle.class);
472 sender = copyStyles(spans, mElidedPaddingToken + sender + mElidedPaddingToken);
477 sender = copyStyles(spans, mSendersSplitToken + sender);
486 private static SpannableString copyStyles(CharacterStyle[] spans, CharSequence newText) { argument
488 if (spans != null && spans.length > 0) {
489 s.setSpan(spans[0], 0, s.length(), 0);
/packages/apps/Mms/src/com/android/mms/ui/
H A DMessageListItem.java619 final URLSpan[] spans = mBodyTextView.getUrls();
621 if (spans.length == 0) {
623 } else if (spans.length == 1) {
624 spans[0].onClick(mBodyTextView);
627 new ArrayAdapter<URLSpan>(mContext, android.R.layout.select_dialog_item, spans) {
668 spans[which].onClick(mBodyTextView);
H A DMessageUtils.java844 public static ArrayList<String> extractUris(URLSpan[] spans) { argument
845 int size = spans.length;
849 accumulator.add(spans[i].getURL());
/packages/apps/UnifiedEmail/src/com/android/mail/browse/
H A DConversationItemView.java1061 // since spans affect text metrics, add spans to the string before measure/layout or fancy
1196 CharacterStyle[] spans = messageInfoString.getSpans(0, messageInfoString.length(),
1200 if (spans.length > 0) {
1201 spans[0].updateDrawState(sPaint);
1218 CharacterStyle[] spans = sender.getSpans(0, sender.length(), CharacterStyle.class);
1220 if (spans.length > 0) {
1221 spans[0].updateDrawState(sPaint);
1227 sender = copyStyles(spans, sElidedPaddingToken + sender + sElidedPaddingToken);
1232 sender = copyStyles(spans, sSendersSplitToke
1268 copyStyles(CharacterStyle[] spans, CharSequence newText) argument
[all...]
/packages/apps/UnifiedEmail/src/com/android/mail/utils/
H A DNotificationUtils.java1043 CharacterStyle[] spans = sender.getSpans(0, sender.length(), CharacterStyle.class);
1046 sender = copyStyles(spans, sElidedPaddingToken + sender + sElidedPaddingToken);
1051 sender = copyStyles(spans, sSendersSplitToken + sender);
1060 private static SpannableString copyStyles(CharacterStyle[] spans, CharSequence newText) { argument
1062 if (spans != null && spans.length > 0) {
1063 s.setSpan(spans[0], 0, s.length(), 0);
/packages/apps/Calendar/src/com/android/calendar/
H A DUtils.java1761 * string will be converted to a single geo link. Any spans that may have previously been
1768 * @return Spannable object containing the list of URL spans found.
1778 * use Linkify result iff it spans the entire text. Otherwise send the user to maps.
1785 URLSpan[] spans = spanText.getSpans(0, spanText.length(), URLSpan.class);
1786 if (spans.length == 1) {
1787 int linkStart = spanText.getSpanStart(spans[0]);
1788 int linkEnd = spanText.getSpanEnd(spans[0]);
1828 * Get a list of any spans created by Linkify, for the coordinate overlapping span check.
1851 * Update the list of existing spans, for the phone number overlapping span check.
1860 * the URI scanner runs first, we just need to avoid creating overlapping spans
[all...]
/packages/apps/Launcher2/src/com/android/launcher2/
H A DCellLayout.java638 // mean that it spans the extent of the CellLayout
1184 * @param spanX The number of horizontal cells that the item spans
1185 * @param spanY The number of vertical cells that the item spans
1418 // how big we can make it. We'll alternate between incrementing x and y spans
2983 * Computes the required horizontal and vertical cell spans to always
3021 * Calculate the grid spans needed to fit given item
3038 int[] spans = rectToCell(minWidth, minHeight, null);
3039 info.spanX = spans[0];
3040 info.spanY = spans[1];
/packages/apps/Launcher3/src/com/android/launcher3/
H A DCellLayout.java634 // mean that it spans the extent of the CellLayout
1176 * @param spanX The number of horizontal cells that the item spans
1177 * @param spanY The number of vertical cells that the item spans
1406 // how big we can make it. We'll alternate between incrementing x and y spans
3010 * Computes the required horizontal and vertical cell spans to always
3051 * Calculate the grid spans needed to fit given item
3068 int[] spans = rectToCell(minWidth, minHeight, null);
3069 info.spanX = spans[0];
3070 info.spanY = spans[1];

Completed in 580 milliseconds