Home
last modified time | relevance | path

Searched refs:mTextView (Results 1 – 25 of 37) sorted by relevance

12

/cts/tests/tests/widget/src/android/widget/cts/
DTextViewTest.java182 private TextView mTextView; field in TextViewTest
221 mTextView = findTextView(R.id.textview_text); in initTextViewForTyping()
222 mTextView.setKeyListener(QwertyKeyListener.getInstance(false, Capitalize.NONE)); in initTextViewForTyping()
223 mTextView.setText("", BufferType.EDITABLE); in initTextViewForTyping()
224 mTextView.requestFocus(); in initTextViewForTyping()
226 mTextView.setTextClassifier(TextClassifier.NO_OP); in initTextViewForTyping()
275 mTextView = new TextView(mActivity); in testGetLineHeight()
276 assertTrue(mTextView.getLineHeight() > 0); in testGetLineHeight()
278 mTextView.setLineSpacing(1.2f, 1.5f); in testGetLineHeight()
279 assertTrue(mTextView.getLineHeight() > 0); in testGetLineHeight()
[all …]
/cts/tests/tests/text/src/android/text/method/cts/
DScrollingMovementMethodTest.java74 private TextView mTextView; field in ScrollingMovementMethodTest
86 mTextView = new TextViewNoIme(mActivity); in setup()
87 mTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12); in setup()
88 mTextView.setText(THREE_LINES_TEXT, BufferType.EDITABLE); in setup()
89 mSpannable = (Spannable) mTextView.getText(); in setup()
111 mTextView.setText("hello world", BufferType.SPANNABLE); in testOnTouchEventHorizontalMotion()
112 mTextView.setSingleLine(); in testOnTouchEventHorizontalMotion()
113 mSpannable = (Spannable) mTextView.getText(); in testOnTouchEventHorizontalMotion()
115 mActivity.setContentView(mTextView, in testOnTouchEventHorizontalMotion()
118 assertNotNull(mTextView.getLayout()); in testOnTouchEventHorizontalMotion()
[all …]
DTouchTest.java61 private TextView mTextView; field in TouchTest
71 mTextView = new TextViewNoIme(mActivity); in setup()
72 mTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10); in setup()
81 mActivity.setContentView(mTextView, new ViewGroup.LayoutParams( in testScrollTo()
83 mTextView.setSingleLine(true); in testScrollTo()
84 mTextView.setLines(2); in testScrollTo()
87 TextPaint paint = mTextView.getPaint(); in testScrollTo()
88 final Layout layout = mTextView.getLayout(); in testScrollTo()
90 mActivityRule.runOnUiThread(() -> mTextView.setText(LONG_TEXT)); in testScrollTo()
97 () -> Touch.scrollTo(mTextView, layout, width - mTextView.getWidth() - 1, 0)); in testScrollTo()
[all …]
DBaseMovementMethodTest.java62 private TextView mTextView; field in BaseMovementMethodTest
78 mActivityRule.runOnUiThread(() -> mTextView = createTextView()); in testOnGenericMotionEvent_horizontalScroll()
80 mTextView.setSingleLine(); in testOnGenericMotionEvent_horizontalScroll()
81 mTextView.setText(testString, EDITABLE); in testOnGenericMotionEvent_horizontalScroll()
85 setContentView(mTextView, (int) mTextView.getPaint().measureText(testLine) / 3); in testOnGenericMotionEvent_horizontalScroll()
87 assertEquals(0, mTextView.getScrollX()); in testOnGenericMotionEvent_horizontalScroll()
89 final Spannable text = (Spannable) mTextView.getText(); in testOnGenericMotionEvent_horizontalScroll()
90 final double lineSpacing = Math.ceil(mTextView.getPaint().getFontSpacing()); in testOnGenericMotionEvent_horizontalScroll()
94 assertTrue(mMovementMethod.onGenericMotionEvent(mTextView, text, event)); in testOnGenericMotionEvent_horizontalScroll()
95 WidgetTestUtils.runOnMainAndDrawSync(mActivityRule, mTextView, null); in testOnGenericMotionEvent_horizontalScroll()
[all …]
DQwertyKeyListenerTest.java74 assertEquals("h", mTextView.getText().toString()); in testOnKeyDown_capitalizeNone()
77 assertEquals("he", mTextView.getText().toString()); in testOnKeyDown_capitalizeNone()
80 assertEquals("hel", mTextView.getText().toString()); in testOnKeyDown_capitalizeNone()
83 assertEquals("hell", mTextView.getText().toString()); in testOnKeyDown_capitalizeNone()
86 assertEquals("hello", mTextView.getText().toString()); in testOnKeyDown_capitalizeNone()
97 assertEquals("H", mTextView.getText().toString()); in testOnKeyDown_capitalizeCharacters()
100 assertEquals("HE", mTextView.getText().toString()); in testOnKeyDown_capitalizeCharacters()
103 assertEquals("HEL", mTextView.getText().toString()); in testOnKeyDown_capitalizeCharacters()
106 assertEquals("HELL", mTextView.getText().toString()); in testOnKeyDown_capitalizeCharacters()
109 assertEquals("HELLO", mTextView.getText().toString()); in testOnKeyDown_capitalizeCharacters()
[all …]
DArrowKeyMovementMethodTest.java77 private TextView mTextView; field in ArrowKeyMovementMethodTest
98 activity.setContentView(mTextView); in setup()
99 mTextView.setFocusable(true); in setup()
100 mTextView.requestFocus(); in setup()
102 PollingCheck.waitFor(() -> mTextView.isFocused() && (mTextView.getLayout() != null)); in setup()
139 mArrowKeyMovementMethod.onTakeFocus(mTextView, mEditable, View.FOCUS_UP); in testOnTakeFocus()
146 mArrowKeyMovementMethod.onTakeFocus(mTextView, mEditable, View.FOCUS_LEFT); in testOnTakeFocus()
151 mActivityRule.runOnUiThread(mTextView::setSingleLine); in testOnTakeFocus()
154 assertNotNull(mTextView.getLayout()); in testOnTakeFocus()
155 assertEquals(1, mTextView.getLayout().getLineCount()); in testOnTakeFocus()
[all …]
DMultiTapKeyListenerTest.java86 mTextView.setKeyListener(mockMultiTapKeyListener); in testOnSpanAdded()
87 mTextView.setText(text, BufferType.EDITABLE); in testOnSpanAdded()
117 assertEquals("h", mTextView.getText().toString()); in testOnKeyDown_capitalizeNone()
120 assertEquals("he", mTextView.getText().toString()); in testOnKeyDown_capitalizeNone()
123 assertEquals("hel", mTextView.getText().toString()); in testOnKeyDown_capitalizeNone()
126 assertEquals("hell", mTextView.getText().toString()); in testOnKeyDown_capitalizeNone()
129 assertEquals("hello", mTextView.getText().toString()); in testOnKeyDown_capitalizeNone()
140 assertEquals("H", mTextView.getText().toString()); in testOnKeyDown_capitalizeCharacters()
143 assertEquals("HE", mTextView.getText().toString()); in testOnKeyDown_capitalizeCharacters()
146 assertEquals("HEL", mTextView.getText().toString()); in testOnKeyDown_capitalizeCharacters()
[all …]
DDateTimeKeyListenerTest.java155 assertEquals(expectedText, mTextView.getText().toString()); in testDateTimeKeyListener()
158 CtsKeyEventUtil.sendString(mInstrumentation, mTextView, "1"); in testDateTimeKeyListener()
160 assertEquals(expectedText, mTextView.getText().toString()); in testDateTimeKeyListener()
163 CtsKeyEventUtil.sendString(mInstrumentation, mTextView, "2"); in testDateTimeKeyListener()
165 assertEquals(expectedText, mTextView.getText().toString()); in testDateTimeKeyListener()
171 CtsKeyEventUtil.sendKeyDownUp(mInstrumentation, mTextView, KeyEvent.KEYCODE_A); in testDateTimeKeyListener()
172 assertEquals(expectedText, mTextView.getText().toString()); in testDateTimeKeyListener()
178 CtsKeyEventUtil.sendKeyDownUp(mInstrumentation, mTextView, KeyEvent.KEYCODE_P); in testDateTimeKeyListener()
179 assertEquals(expectedText, mTextView.getText().toString()); in testDateTimeKeyListener()
185 CtsKeyEventUtil.sendKeyDownUp(mInstrumentation, mTextView, KeyEvent.KEYCODE_M); in testDateTimeKeyListener()
[all …]
DTimeKeyListenerTest.java152 assertEquals(expectedText, mTextView.getText().toString()); in testTimeKeyListener()
155 CtsKeyEventUtil.sendString(mInstrumentation, mTextView, "1"); in testTimeKeyListener()
157 assertEquals(expectedText, mTextView.getText().toString()); in testTimeKeyListener()
160 CtsKeyEventUtil.sendString(mInstrumentation, mTextView, "2"); in testTimeKeyListener()
162 assertEquals("12", mTextView.getText().toString()); in testTimeKeyListener()
168 CtsKeyEventUtil.sendKeyDownUp(mInstrumentation, mTextView, KeyEvent.KEYCODE_A); in testTimeKeyListener()
169 assertEquals(expectedText, mTextView.getText().toString()); in testTimeKeyListener()
175 CtsKeyEventUtil.sendKeyDownUp(mInstrumentation, mTextView, KeyEvent.KEYCODE_P); in testTimeKeyListener()
176 assertEquals(expectedText, mTextView.getText().toString()); in testTimeKeyListener()
182 CtsKeyEventUtil.sendKeyDownUp(mInstrumentation, mTextView, KeyEvent.KEYCODE_M); in testTimeKeyListener()
[all …]
DDateKeyListenerTest.java151 assertEquals("", mTextView.getText().toString()); in testDateTimeKeyListener()
154 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, KeyEvent.KEYCODE_1); in testDateTimeKeyListener()
155 assertEquals("1", mTextView.getText().toString()); in testDateTimeKeyListener()
158 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, KeyEvent.KEYCODE_2); in testDateTimeKeyListener()
159 assertEquals("12", mTextView.getText().toString()); in testDateTimeKeyListener()
164 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, keyCode); in testDateTimeKeyListener()
165 assertEquals("12", mTextView.getText().toString()); in testDateTimeKeyListener()
169 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, KeyEvent.KEYCODE_MINUS); in testDateTimeKeyListener()
170 assertEquals("12-", mTextView.getText().toString()); in testDateTimeKeyListener()
173 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, KeyEvent.KEYCODE_SLASH); in testDateTimeKeyListener()
[all …]
DDigitsKeyListenerTest.java554 assertEquals("", mTextView.getText().toString()); in testDigitsKeyListener1()
557 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, KeyEvent.KEYCODE_MINUS); in testDigitsKeyListener1()
558 assertEquals("", mTextView.getText().toString()); in testDigitsKeyListener1()
561 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, KeyEvent.KEYCODE_1); in testDigitsKeyListener1()
562 assertEquals("1", mTextView.getText().toString()); in testDigitsKeyListener1()
565 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, KeyEvent.KEYCODE_PERIOD); in testDigitsKeyListener1()
566 assertEquals("1", mTextView.getText().toString()); in testDigitsKeyListener1()
569 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, KeyEvent.KEYCODE_2); in testDigitsKeyListener1()
570 assertEquals("12", mTextView.getText().toString()); in testDigitsKeyListener1()
589 assertEquals("", mTextView.getText().toString()); in testDigitsKeyListener2()
[all …]
DBaseKeyListenerTest.java62 mockBaseKeyListener.backspace(mTextView, content, event.getKeyCode(), event); in verifyBackspace()
67 mockBaseKeyListener.backspace(mTextView, content, event.getKeyCode(), event); in verifyBackspace()
72 mockBaseKeyListener.backspace(mTextView, content, event.getKeyCode(), event); in verifyBackspace()
74 mockBaseKeyListener.backspace(mTextView, content, event.getKeyCode(), event); in verifyBackspace()
82 mockBaseKeyListener.backspace(mTextView, content, event.getKeyCode(), event); in verifyBackspace()
87 mockBaseKeyListener.backspace(mTextView, content, event.getKeyCode(), event); in verifyBackspace()
92 mockBaseKeyListener.backspace(mTextView, content, event.getKeyCode(), event); in verifyBackspace()
100 mockBaseKeyListener.backspace(mTextView, content, event.getKeyCode(), event); in verifyBackspace()
105 mockBaseKeyListener.backspace(mTextView, content, event.getKeyCode(), event); in verifyBackspace()
109 mockBaseKeyListener.backspace(mTextView, content, event.getKeyCode(), event); in verifyBackspace()
[all …]
DNumberKeyListenerTest.java146 mTextView.setText(text, BufferType.EDITABLE); in testPressKey()
147 mTextView.setKeyListener(mockNumberKeyListener); in testPressKey()
148 mTextView.requestFocus(); in testPressKey()
149 Selection.setSelection(mTextView.getText(), 0, 0); in testPressKey()
152 assertEquals("123456", mTextView.getText().toString()); in testPressKey()
154 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, KeyEvent.KEYCODE_0); in testPressKey()
155 assertEquals("0123456", mTextView.getText().toString()); in testPressKey()
160 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, keyCode); in testPressKey()
162 assertEquals("0123456", mTextView.getText().toString()); in testPressKey()
166 mTextView.setKeyListener(null); in testPressKey()
[all …]
DTextKeyListenerTest.java109 mTextView.setKeyListener(mockTextKeyListener); in testOnSpanAdded()
110 mTextView.setText(text, BufferType.EDITABLE); in testOnSpanAdded()
171 mTextView.setText(text, BufferType.EDITABLE); in testClear()
173 Editable content = mTextView.getText(); in testClear()
211 mTextView.setText("", BufferType.EDITABLE); in testPressKey()
212 Selection.setSelection(mTextView.getText(), 0, 0); in testPressKey()
213 mTextView.setKeyListener(textKeyListener); in testPressKey()
214 mTextView.requestFocus(); in testPressKey()
217 assertEquals("", mTextView.getText().toString()); in testPressKey()
219 CtsKeyEventUtil.sendKeys(mInstrumentation, mTextView, KeyEvent.KEYCODE_4); in testPressKey()
[all …]
DForwardDeleteTest.java48 mTextView.setText(state.mText, BufferType.EDITABLE); in forwardDelete()
49 mTextView.setKeyListener(mKeyListener); in forwardDelete()
50 mTextView.setSelection(state.mSelectionStart, state.mSelectionEnd); in forwardDelete()
53 assertTrue(mTextView.hasWindowFocus()); in forwardDelete()
56 mActivity.runOnUiThread(() -> mTextView.onKeyDown(keyEvent.getKeyCode(), keyEvent)); in forwardDelete()
59 state.mText = mTextView.getText(); in forwardDelete()
60 state.mSelectionStart = mTextView.getSelectionStart(); in forwardDelete()
61 state.mSelectionEnd = mTextView.getSelectionEnd(); in forwardDelete()
DBackspaceTest.java48 mTextView.setText(state.mText, BufferType.EDITABLE); in backspace()
49 mTextView.setKeyListener(mKeyListener); in backspace()
50 mTextView.setSelection(state.mSelectionStart, state.mSelectionEnd); in backspace()
53 assertTrue(mTextView.hasWindowFocus()); in backspace()
56 mActivityRule.runOnUiThread(() -> mTextView.onKeyDown(keyEvent.getKeyCode(), keyEvent)); in backspace()
59 state.mText = mTextView.getText(); in backspace()
60 state.mSelectionStart = mTextView.getSelectionStart(); in backspace()
61 state.mSelectionEnd = mTextView.getSelectionEnd(); in backspace()
/cts/tests/tests/assist/testapp/src/android/assist/testapp/
DTextViewActivity.java30 private TextView mTextView; field in TextViewActivity
39 mTextView = findViewById(R.id.text_view); in onCreate()
40 mTextView.setMovementMethod(new ScrollingMovementMethod()); in onCreate()
54 scrollX = mTextView.getWidth(); in onReceivedEventFromCaller()
55 scrollY = mTextView.getLayout().getLineTop(mTextView.getLineCount()) in onReceivedEventFromCaller()
56 - mTextView.getHeight(); in onReceivedEventFromCaller()
58 TextViewActivity.this.mTextView.scrollTo(scrollX, scrollY); in onReceivedEventFromCaller()
69 Log.i(TAG, "the max height of this textview is: " + mTextView.getHeight()); in onReceivedEventFromCaller()
70 Log.i(TAG, "the max line count of this text view is: " + mTextView.getMaxLines()); in onReceivedEventFromCaller()
/cts/tests/tests/assist/src/android/assist/cts/
DTestStartActivity.java36 private TextView mTextView; field in TestStartActivity
51 mTextView = findViewById(R.id.text_view); in onCreate()
115 scrollX = mTextView.getWidth(); in scrollText()
116 … scrollY = mTextView.getLayout().getLineTop(mTextView.getLineCount()) - mTextView.getHeight(); in scrollText()
123 mTextView.scrollTo(finalScrollX, finalScrollY); in scrollText()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/nfc/
DLlcpVersionActivity.java45 private TextView mTextView; field in LlcpVersionActivity
55 mTextView = (TextView) findViewById(R.id.text); in onCreate()
56 mTextView.setText(R.string.nfc_llcp_version_check_info); in onCreate()
109 mTextView.setText(R.string.nfc_llcp_version_check_failure); in createNdefMessage()
117 mTextView.setText(R.string.nfc_llcp_version_check_success); in createNdefMessage()
/cts/tests/framework/base/windowmanager/dndtargetappsdk23/src/android/server/wm/dndtargetappsdk23/
DDropTarget.java36 private TextView mTextView; field in DropTarget
46 mTextView = (TextView) findViewById(R.id.drag_target); in onCreate()
47 mTextView.setOnDragListener(new OnDragListener()); in onCreate()
54 mTextView.setText(key + "=" + value); in logResult()
/cts/tests/framework/base/windowmanager/dndsourceapp/src/android/server/wm/dndsourceapp/
DDragSource.java46 private TextView mTextView; field in DragSource
90 mTextView = (TextView) findViewById(R.id.drag_source); in setUpDragSource()
91 mTextView.setText(mode); in setUpDragSource()
92 mTextView.setOnTouchListener(new View.OnTouchListener() { in setUpDragSource()
131 mTextView.setText(mTextView.getText() + "\n" + key + "=" + value); in logResult()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/nfc/hce/
DTapTestEmulatorActivity.java15 TextView mTextView; field in TapTestEmulatorActivity
24 mTextView = (TextView) findViewById(R.id.text); in onCreate()
32 mTextView.setText("Number of successful taps: 0/50."); in onResume()
57 mTextView.setText("Number of successful taps: " + Integer.toString(mNumTaps) + in onApduSequenceComplete()
DThroughputEmulatorActivity.java15 TextView mTextView; field in ThroughputEmulatorActivity
23 mTextView = (TextView) findViewById(R.id.text); in onCreate()
54 mTextView.setText("PASS. Total duration: " + Long.toString(duration) + " ms " + in onApduSequenceComplete()
58 mTextView.setText("FAIL. Total duration: " + Long.toString(duration) + " ms " + in onApduSequenceComplete()
DSimpleReaderActivity.java42 TextView mTextView; field in SimpleReaderActivity
57 mTextView = (TextView) findViewById(R.id.text); in onCreate()
58 mTextView.setTextSize(12.0f); in onCreate()
59 mTextView.setText(R.string.nfc_hce_type_selection); in onCreate()
135 mTextView.setText(sb.toString()); in onTagDiscovered()
145 mTextView.setText(sb.toString()); in onTagDiscovered()
159 mTextView.setText(sb.toString()); in onTagDiscovered()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/p2p/
DRequesterTestActivity.java72 private TextView mTextView; field in RequesterTestActivity
113 mTextView = (TextView) findViewById(id.p2p_req_text); in onCreate()
183 mTextView.setText(msg); in onTestMsgReceived()
197 mTextView.setText(reason); in onTestFailed()
208 mTextView.setText(R.string.p2p_result_success); in onTestSuccess()
236 mTextView.setText(R.string.p2p_searching_target); in searchTarget()
260 mTextView.setText( in searchTarget()

12