android-edittext

Strike html tag not rendering in EditText with TextFormatted

孤者浪人 提交于 2020-02-22 07:32:27
问题 I am attempting to render an html string within an EditText control. Bold, italic, and underline html renders correctly, however strike through is just ignored. Here is the EditText control, nothing fancy: <EditText android:id="@+id/rich_text" android:layout_width="match_parent" android:layout_height="wrap_content" style="@style/Widget.EditText" android:gravity="top" android:inputType="textFilter|textMultiLine|textNoSuggestions" android:minLines="8" android:textStyle="normal" /> And here is

Multi line Edit Text and first letter capitalization of Edit Text

旧时模样 提交于 2020-02-21 10:05:11
问题 Hello I am trying to make EditText to multi line and first letter should be type as in capital which I am doing using android:inputType="textCapSentences" but after setting to input type to textCapSentences it set first letter in capital but EditText is single line only. Can you please help me to make EditText to multiline plus first letter should be type in capital Here it is current EditText <EditText android:id="@+id/commentsEditText" android:layout_width="match_parent" android:layout

Android EditText: select all text while touch and clear when user starts typing.

有些话、适合烂在心里 提交于 2020-02-20 07:01:29
问题 I have a edit text in my app. When the user touches the edit text the whole text should be selected and when he starts typing text should be cleared. An example is browser address bar. Is there any way to do this?Please help me. 回答1: You can select all text in EditText by using android:selectAllOnFocus and also setSelectAllOnFocus(boolean) 回答2: Call EditText.setSelectAllOnFocus(boolean selectAllOnFocus) to select all text on focus. Set a click listener to your EditText and in onClick call

Android EditText: select all text while touch and clear when user starts typing.

こ雲淡風輕ζ 提交于 2020-02-20 06:58:08
问题 I have a edit text in my app. When the user touches the edit text the whole text should be selected and when he starts typing text should be cleared. An example is browser address bar. Is there any way to do this?Please help me. 回答1: You can select all text in EditText by using android:selectAllOnFocus and also setSelectAllOnFocus(boolean) 回答2: Call EditText.setSelectAllOnFocus(boolean selectAllOnFocus) to select all text on focus. Set a click listener to your EditText and in onClick call

Custom EditText freezes on clearing text using backspace

为君一笑 提交于 2020-02-08 06:47:33
问题 I have implemented a Custom EditText which can take Bold, Italics, Underline text. Everything works fine except when I try to delete text by long pressing the backspace button. On long pressing backspace there is a delay in clearing the text. Here is the overriden onTextChanged() method protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) { Log.d(VIEW_LOG_TAG,"Start: "+start+" Length before: "+lengthBefore+" Length After: "+lengthAfter+" TextLength: "

Custom EditText freezes on clearing text using backspace

守給你的承諾、 提交于 2020-02-08 06:47:13
问题 I have implemented a Custom EditText which can take Bold, Italics, Underline text. Everything works fine except when I try to delete text by long pressing the backspace button. On long pressing backspace there is a delay in clearing the text. Here is the overriden onTextChanged() method protected void onTextChanged(CharSequence text, int start, int lengthBefore, int lengthAfter) { Log.d(VIEW_LOG_TAG,"Start: "+start+" Length before: "+lengthBefore+" Length After: "+lengthAfter+" TextLength: "

getText vs onTextChanged charSequence

时光毁灭记忆、已成空白 提交于 2020-02-08 00:54:08
问题 I am learning how to write applications for android and have a question. What is the difference between using a TextWatcher and within the the onTextChanged Method, setting a string value equal to the CharSequence argument and simply using getText method. private TextWatcher passwordListener = new TextWatcher() { @Override public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) { } @Override public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {

Unresponsive soft keyboard for a couple of seconds in EditText when I move the cursor in the widget

为君一笑 提交于 2020-02-06 07:51:06
问题 When I move the cursor in a EditText widget the soft keyboard is unresponsive for a couple of seconds. I have cold booted the device, and tried a different keyboard but the problem remains in just one EditText widget. This problem does not happen on a tablet or in the emulator just on this Samsung Galaxy S7. It also does not happen for the same EditText widget when I rotate the device to landscape, where the softkeyboard covers the screen with it's own attached edit window. Which suggests the

Prevent EditText from going to new line when 'Space' is tapped

前提是你 提交于 2020-02-05 04:32:12
问题 I want to have an EditText which is multi Line and First Letter of a Sentence to be capital. I'm using: <EditText android:id="@+id/editText2" android:layout_width="300dp" android:layout_height="150dp" android:layout_alignParentStart="true" android:layout_alignParentTop="true" android:layout_marginStart="32dp" android:layout_marginTop="67dp" android:background="#ddebed" android:ems="10" android:inputType="textMultiLine|textCapSentences" android:singleLine="false" android:text="@string/same" />

Android EditText Resize Programmatically

牧云@^-^@ 提交于 2020-02-05 01:29:30
问题 I have a view in which I have two LinearLayouts - one with Text, EditText and a Button and one with just Text and EditText. I am trying to get the width of the second EditText (on the second line) to match the width of the first line. I have tried making it a TableLayout instead of just using LinearLayouts and now am trying to set the width programmatically. I get the width of the first EditText and try to setWidth of the second EditText, but it doesn't change sizes. * JAVA RESIZE ATTEMPT *