Home
last modified time | relevance | path

Searched refs:text (Results 1 – 25 of 2007) sorted by relevance

12345678910>>...81

/frameworks/base/core/tests/coretests/src/android/text/method/
DWordIteratorTest.java17 package android.text.method;
32 import java.text.BreakIterator;
154 final String text = "text"; in testSetCharSequence() local
158 wordIterator.setCharSequence(text, 100, 100); in testSetCharSequence()
164 wordIterator.setCharSequence(text, -100, -100); in testSetCharSequence()
170 wordIterator.setCharSequence(text, 0, text.length()); in testSetCharSequence()
171 wordIterator.setCharSequence(text, 0, 0); in testSetCharSequence()
172 wordIterator.setCharSequence(text, text.length(), text.length()); in testSetCharSequence()
177 final String text = "aaaa bbbb cccc dddd eeee ffff gggg hhhh iiii jjjj kkkk llll mmmm nnnn"; in testWindowWidth() local
181 wordIterator.setCharSequence(text, text.indexOf('n'), text.length()); in testWindowWidth()
[all …]
/frameworks/base/core/java/android/text/
DSelection.java17 package android.text;
22 import java.text.BreakIterator;
40 public static final int getSelectionStart(CharSequence text) { in getSelectionStart() argument
41 if (text instanceof Spanned) { in getSelectionStart()
42 return ((Spanned) text).getSpanStart(SELECTION_START); in getSelectionStart()
51 public static final int getSelectionEnd(CharSequence text) { in getSelectionEnd() argument
52 if (text instanceof Spanned) { in getSelectionEnd()
53 return ((Spanned) text).getSpanStart(SELECTION_END); in getSelectionEnd()
58 private static int getSelectionMemory(CharSequence text) { in getSelectionMemory() argument
59 if (text instanceof Spanned) { in getSelectionMemory()
[all …]
DHtml.java17 package android.text;
26 import android.text.style.AbsoluteSizeSpan;
27 import android.text.style.AlignmentSpan;
28 import android.text.style.BackgroundColorSpan;
29 import android.text.style.BulletSpan;
30 import android.text.style.CharacterStyle;
31 import android.text.style.ForegroundColorSpan;
32 import android.text.style.ImageSpan;
33 import android.text.style.ParagraphStyle;
34 import android.text.style.QuoteSpan;
[all …]
/frameworks/base/tools/streaming_proto/cpp/
Dmain.cpp22 write_enum(stringstream& text, const EnumDescriptorProto& enu, const string& indent) in write_enum() argument
25 text << indent << "// enum " << enu.name() << endl; in write_enum()
28 text << indent << "const int " in write_enum()
36 text << indent << "const int _ENUM_" << name << "_COUNT = " << N << ";" << endl; in write_enum()
37 text << indent << "const char* _ENUM_" << name << "_NAMES[" << N << "] = {" << endl; in write_enum()
39text << indent << INDENT << "\"" << stripPrefix(enu.value(i).name(), prefix) << "\"," << endl; in write_enum()
41 text << indent << "};" << endl; in write_enum()
42 text << indent << "const int _ENUM_" << name << "_VALUES[" << N << "] = {" << endl; in write_enum()
44 text << indent << INDENT << make_constant_name(enu.value(i).name()) << "," << endl; in write_enum()
46 text << indent << "};" << endl; in write_enum()
[all …]
/frameworks/minikin/tests/unittest/
DLayoutTest.cpp57 std::vector<uint16_t> text; in TEST_F() local
62 text = utf8ToUtf16("oneword"); in TEST_F()
63 Range range(0, text.size()); in TEST_F()
64 Layout layout(text, range, Bidi::LTR, paint, StartHyphenEdit::NO_EDIT, in TEST_F()
72 expectedValues.resize(text.size()); in TEST_F()
80 text = utf8ToUtf16("two words"); in TEST_F()
81 Range range(0, text.size()); in TEST_F()
82 Layout layout(text, range, Bidi::LTR, paint, StartHyphenEdit::NO_EDIT, in TEST_F()
90 expectedValues.resize(text.size()); in TEST_F()
98 text = utf8ToUtf16("three words test"); in TEST_F()
[all …]
DMeasuredTextTest.cpp45 std::vector<uint16_t> text(CHAR_COUNT, 'a'); in TEST() local
48 builder.build(text, true /* compute hyphenation */, false /* compute full layout */, in TEST()
61 auto text = utf8ToUtf16("Hello, World!"); in TEST() local
67 builder.addStyleRun(0, text.size(), std::move(paint), false /* is RTL */); in TEST()
68 auto mt = builder.build(text, true /* hyphenation */, true /* full layout */, in TEST()
71 EXPECT_EQ(MinikinRect(0.0f, 0.0f, 0.0f, 0.0f), mt->getBounds(text, Range(0, 0))); in TEST()
72 EXPECT_EQ(MinikinRect(0.0f, 10.0f, 10.0f, 0.0f), mt->getBounds(text, Range(0, 1))); in TEST()
73 EXPECT_EQ(MinikinRect(0.0f, 10.0f, 20.0f, 0.0f), mt->getBounds(text, Range(0, 2))); in TEST()
74 EXPECT_EQ(MinikinRect(0.0f, 10.0f, 10.0f, 0.0f), mt->getBounds(text, Range(1, 2))); in TEST()
75 EXPECT_EQ(MinikinRect(0.0f, 10.0f, 130.0f, 0.0f), mt->getBounds(text, Range(0, text.size()))); in TEST()
[all …]
DBidiUtilsTest.cpp33 auto text = utf8ToUtf16(LTR_1); in TEST() local
34 uint32_t ltrLength = text.size(); in TEST()
36 BidiText bidiText(text, Range(0, ltrLength), Bidi::LTR); in TEST()
45 BidiText bidiText(text, Range(0, ltrLength), Bidi::RTL); in TEST()
54 BidiText bidiText(text, Range(0, ltrLength), Bidi::DEFAULT_LTR); in TEST()
63 BidiText bidiText(text, Range(0, ltrLength), Bidi::DEFAULT_RTL); in TEST()
72 BidiText bidiText(text, Range(0, ltrLength), Bidi::FORCE_LTR); in TEST()
81 BidiText bidiText(text, Range(0, ltrLength), Bidi::FORCE_RTL); in TEST()
92 auto text = utf8ToUtf16(RTL_1); in TEST() local
93 uint32_t rtlLength = text.size(); in TEST()
[all …]
/frameworks/base/core/java/android/widget/
DMultiAutoCompleteTextView.java20 import android.text.Editable;
21 import android.text.SpannableString;
22 import android.text.Spanned;
23 import android.text.TextUtils;
24 import android.text.method.QwertyKeyListener;
94 protected void performFiltering(CharSequence text, int keyCode) { in performFiltering() argument
97 int start = mTokenizer.findTokenStart(text, end); in performFiltering()
99 performFiltering(text, start, end, keyCode); in performFiltering()
119 Editable text = getText(); in enoughToFilter() local
126 int start = mTokenizer.findTokenStart(text, end); in enoughToFilter()
[all …]
/frameworks/base/tools/powermodel/test/com/android/powermodel/
DCsvParserTest.java62 final String text = ""; in testEmpty() local
63 System.out.println("Test: [" + text + "]"); in testEmpty()
64 final InputStream is = new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8)); in testEmpty()
74 final String text = "\n"; in testOnlyNewline() local
75 System.out.println("Test: [" + text + "]"); in testOnlyNewline()
76 final InputStream is = new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8)); in testOnlyNewline()
86 final String text = "one,twoo,3\nfour,5,six\n"; in testTwoLines() local
87 System.out.println("Test: [" + text + "]"); in testTwoLines()
88 final InputStream is = new ByteArrayInputStream(text.getBytes(StandardCharsets.UTF_8)); in testTwoLines()
101 final String text = "\"\",\"\",\"\"\n"; in testEscapedEmpty() local
[all …]
/frameworks/base/apct-tests/perftests/core/src/android/text/
DStaticLayoutPerfTest.java17 package android.text;
56 private PrecomputedText makeMeasured(CharSequence text, TextPaint paint) { in makeMeasured() argument
58 return PrecomputedText.create(text, param); in makeMeasured()
61 private PrecomputedText makeMeasured(CharSequence text, TextPaint paint, int strategy, in makeMeasured() argument
65 return PrecomputedText.create(text, param); in makeMeasured()
71 final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT); in testCreate_FixedText_NoStyle_Greedy_NoHyphenation() local
73 StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH) in testCreate_FixedText_NoStyle_Greedy_NoHyphenation()
85 final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT); in testCreate_RandomText_NoStyled_Greedy_NoHyphenation() local
88 StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH) in testCreate_RandomText_NoStyled_Greedy_NoHyphenation()
100 final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT); in testCreate_RandomText_NoStyled_Greedy_Hyphenation() local
[all …]
/frameworks/base/tools/stringslint/
Dstringslint.py105 elif tag.text:
106 yield decode_escapes(tag.text)
135 text = "".join(child.itertext())
143 if "do not translate" in comment.text.lower():
155 limit = re.search("CHAR[ _-]LIMIT=(\d+|NONE|none)", comment.text)
166 if "'" in text:
168 text, "This doesn\u2019t need to \u2018happen\u2019 today")
169 if '"' in text and not text.startswith('"') and text.endswith('"'):
171 text, "This needs to \u201chappen\u201d today")
172 if "..." in text:
[all …]
/frameworks/base/core/tests/coretests/src/android/widget/
DTextViewActivityMouseTest.java120 final String text = "abc def ghi."; in testContextMenu() local
122 onView(withId(R.id.textview)).perform(replaceText(text)); in testContextMenu()
127 mouseClickOnTextAtIndex(text.indexOf("d"), MotionEvent.BUTTON_SECONDARY)); in testContextMenu()
140 mouseClickOnTextAtIndex(text.indexOf("."))); in testContextMenu()
144 mouseClickOnTextAtIndex(text.indexOf("d"), MotionEvent.BUTTON_SECONDARY)); in testContextMenu()
156 mouseDragOnText(text.indexOf("c"), text.indexOf("h"))); in testContextMenu()
158 mouseClickOnTextAtIndex(text.indexOf("d"), MotionEvent.BUTTON_SECONDARY)); in testContextMenu()
171 mouseClickOnTextAtIndex(text.indexOf("i"), MotionEvent.BUTTON_SECONDARY)); in testContextMenu()
181 onView(withId(R.id.textview)).check(hasInsertionPointerAtIndex(text.indexOf("i"))); in testContextMenu()
188 final String text = "abc def ghi."; in testDragAndDrop() local
[all …]
DSuggestionsPopupWindowTest.java47 import android.text.Selection;
48 import android.text.Spannable;
49 import android.text.Spanned;
50 import android.text.TextPaint;
51 import android.text.style.SuggestionSpan;
52 import android.text.style.TextAppearanceSpan;
82 final Spannable text = (Spannable) textView.getText(); in setSuggestionSpan() local
83 text.setSpan(span, start, end, Spanned.SPAN_INCLUSIVE_INCLUSIVE); in setSuggestionSpan()
84 Selection.setSelection(text, (start + end) / 2); in setSuggestionSpan()
91 final String text = "abc def ghi"; in testOnTextContextMenuItem() local
[all …]
DTextViewActivityTest.java65 import android.text.InputType;
66 import android.text.Selection;
67 import android.text.Spannable;
68 import android.text.SpannableString;
69 import android.text.method.LinkMovementMethod;
144 final String text = "\u0623\u064F\u067A\u0633\u0652"; in testPositionCursorAtTextAtIndex_arabic() local
145 onView(withId(R.id.textview)).perform(replaceText(text)); in testPositionCursorAtTextAtIndex_arabic()
164 final String text = "\u0915\u093E"; in testPositionCursorAtTextAtIndex_devanagari() local
165 onView(withId(R.id.textview)).perform(replaceText(text)); in testPositionCursorAtTextAtIndex_devanagari()
212 final String text = "\uD83D\uDE00\uD83D\uDE01\uD83D\uDE02\uD83D\uDE03"; in testLongPressAndDragToSelect_emoji() local
[all …]
/frameworks/base/telephony/java/android/telephony/
DJapanesePhoneNumberFormatter.java20 import android.text.Editable;
159 public static void format(Editable text) { in format() argument
164 int length = text.length(); in format()
166 && text.subSequence(0, 3).toString().equals("+81")) { in format()
168 } else if (length < 1 || text.charAt(0) != '0') { in format()
172 CharSequence saved = text.subSequence(0, length); in format()
176 while (i < text.length()) { in format()
177 if (text.charAt(i) == '-') { in format()
178 text.delete(i, i + 1); in format()
184 length = text.length(); in format()
[all …]
/frameworks/base/core/java/com/google/android/util/
DAbstractMessageParser.java71 private String text; field in AbstractMessageParser
90 public AbstractMessageParser(String text) { in AbstractMessageParser() argument
91 this(text, true, true, true, true, true, true); in AbstractMessageParser()
100 public AbstractMessageParser(String text, boolean parseSmilies, in AbstractMessageParser() argument
103 this.text = text; in AbstractMessageParser()
118 public final String getRawText() { return text; } in getRawText()
140 if (parseMeText && text.startsWith("/me") && (text.length() > 3) && in parse()
141 Character.isWhitespace(text.charAt(3))) { in parse()
142 meText = text.substring(0, 4); in parse()
143 text = text.substring(4); in parse()
[all …]
/frameworks/base/tools/aapt/
Dpseudolocalize.h12 virtual String16 text(const String16& text) = 0;
13 virtual String16 placeholder(const String16& text) = 0;
19 String16 text(const String16& text) { return text; } in text() argument
20 String16 placeholder(const String16& text) { return text; } in placeholder() argument
27 String16 text(const String16& text);
28 String16 placeholder(const String16& text);
36 String16 text(const String16& text);
37 String16 placeholder(const String16& text);
51 String16 text(const String16& text);
/frameworks/base/core/tests/coretests/src/android/view/textclassifier/
DTextClassifierUtilsTest.java35 final String text = "Yakuza call themselves 任侠団体"; in testGetSubString() local
41 start = text.indexOf("任侠団体"); in testGetSubString()
42 end = text.length(); in testGetSubString()
44 assertThat(TextClassifier.Utils.getSubString(text, start, end, minimumLength)) in testGetSubString()
51 assertThat(TextClassifier.Utils.getSubString(text, start, end, minimumLength)) in testGetSubString()
55 start = text.indexOf("all"); in testGetSubString()
58 assertThat(TextClassifier.Utils.getSubString(text, start, end, minimumLength)) in testGetSubString()
62 start = text.indexOf("themselves"); in testGetSubString()
65 assertThat(TextClassifier.Utils.getSubString(text, start, end, minimumLength)) in testGetSubString()
69 minimumLength = text.length() + 1; in testGetSubString()
[all …]
/frameworks/base/tools/streaming_proto/java/
Dmain.cpp76 write_enum(stringstream& text, const EnumDescriptorProto& enu, const string& indent) in write_enum() argument
79 text << indent << "// enum " << enu.name() << endl; in write_enum()
82 text << indent << "public static final int " in write_enum()
86 text << endl; in write_enum()
93 write_field(stringstream& text, const FieldDescriptorProto& field, const string& indent) in write_field() argument
102 text << indent << "// " << optional_comment << repeated_comment << proto_type << ' ' in write_field()
105 text << indent << "public static final long " << make_constant_name(field.name()) << " = 0x"; in write_field()
107 ios::fmtflags fmt(text.flags()); in write_field()
108 text << setfill('0') << setw(16) << hex << get_field_id(field); in write_field()
109 text.flags(fmt); in write_field()
[all …]
/frameworks/base/graphics/java/android/graphics/
DPaint.java31 import android.text.GraphicsOperations;
32 import android.text.SpannableString;
33 import android.text.SpannedString;
34 import android.text.TextUtils;
2167 public float measureText(char[] text, int index, int count) { in measureText() argument
2168 if (text == null) { in measureText()
2171 if ((index | count) < 0 || index + count > text.length) { in measureText()
2175 if (text.length == 0 || count == 0) { in measureText()
2179 return (float) Math.ceil(nGetTextAdvances(mNativePaint, text, in measureText()
2185 final float w = nGetTextAdvances(mNativePaint, text, index, count, index, count, in measureText()
[all …]
/frameworks/base/core/java/android/text/format/
DRelativeDateTimeFormatter.java17 package android.text.format;
19 import static android.text.format.DateUtils.FORMAT_ABBREV_ALL;
20 import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
21 import static android.text.format.DateUtils.FORMAT_ABBREV_RELATIVE;
22 import static android.text.format.DateUtils.FORMAT_NO_YEAR;
23 import static android.text.format.DateUtils.FORMAT_NUMERIC_DATE;
24 import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
25 import static android.text.format.DateUtils.FORMAT_SHOW_TIME;
26 import static android.text.format.DateUtils.FORMAT_SHOW_YEAR;
30 import android.icu.text.DisplayContext;
[all …]
/frameworks/base/core/java/android/text/util/
DRfc822Tokenizer.java17 package android.text.util;
45 public static void tokenize(CharSequence text, Collection<Rfc822Token> out) { in tokenize() argument
51 int cursor = text.length(); in tokenize()
54 char c = text.charAt(i); in tokenize()
59 while (i < cursor && text.charAt(i) == ' ') { in tokenize()
82 c = text.charAt(i); in tokenize()
89 name.append(text.charAt(i + 1)); in tokenize()
102 c = text.charAt(i); in tokenize()
117 comment.append(text.charAt(i + 1)); in tokenize()
129 c = text.charAt(i); in tokenize()
[all …]
/frameworks/opt/setupwizard/library/platform/src/com/android/setupwizardlib/view/
DRichTextView.java20 import android.text.Annotation;
21 import android.text.SpannableString;
22 import android.text.Spanned;
23 import android.text.method.MovementMethod;
24 import android.text.style.ClickableSpan;
25 import android.text.style.TextAppearanceSpan;
64 public static CharSequence getRichText(Context context, CharSequence text) { in getRichText() argument
65 if (text instanceof Spanned) { in getRichText()
66 final SpannableString spannable = new SpannableString(text); in getRichText()
88 return text; in getRichText()
[all …]
/frameworks/base/core/tests/coretests/src/android/graphics/
DPaintTest.java53 public HintingTestCase(String text, float textSize, float[] widthWithoutHinting, in HintingTestCase() argument
55 mText = text; in HintingTestCase()
168 String text = "abcdef"; in testGetTextRunAdvances() local
169 assertGetTextRunAdvances(text, 0, text.length(), 0, text.length(), false, true); in testGetTextRunAdvances()
170 assertGetTextRunAdvances(text, 1, text.length() - 1, 0, text.length(), false, false); in testGetTextRunAdvances()
174 final String text = in testGetTextRunAdvances() local
179 assertGetTextRunAdvances(text, 0, text.length(), 0, text.length(), true, true); in testGetTextRunAdvances()
180 assertGetTextRunAdvances(text, 1, text.length() - 1, 0, text.length(), true, false); in testGetTextRunAdvances()
223 char[] text = "test".toCharArray(); in testGetTextRunAdvances_invalid() local
232 p.getTextRunAdvances(text, 0, text.length, 0, text.length, false, in testGetTextRunAdvances_invalid()
[all …]
/frameworks/base/core/tests/coretests/src/android/text/style/
DUnderlineSpanTest.java17 package android.text.style;
22 import android.text.SpannableString;
23 import android.text.Spanned;
24 import android.text.StaticLayout;
25 import android.text.TextPaint;
49 final SpannableString text = new SpannableString("P."); in testDoesntAffectWidth_colorUnderlineSubclass() local
50 final float origLineWidth = textWidth(text); in testDoesntAffectWidth_colorUnderlineSubclass()
52 text.setSpan(new RedUnderlineSpan(), 0, 1, Spanned.SPAN_INCLUSIVE_INCLUSIVE); in testDoesntAffectWidth_colorUnderlineSubclass()
53 final float underlinedLineWidth = textWidth(text); in testDoesntAffectWidth_colorUnderlineSubclass()
58 private float textWidth(CharSequence text) { in textWidth() argument
[all …]

12345678910>>...81