android-edittext

How to disable Android Soft Keyboard for a particular activity?

风格不统一 提交于 2019-12-03 06:18:01
I have an activity with one EditText where I need to input numbers only. Now, I have defined the Input Type for my EditText to be number only and have drawn up a pretty keypad for my user to use, however I also need to make sure the soft keyboard doesn't pop up for my user when they click on the EditText. I have tried hiding the keyboard through the manifest by adding android:windowSoftInputMode="stateAlwaysHidden" in my Manifest for the particular activity, but this doesn't work for me because as soon as the user clicks on the EditText the keyboard appears again. I've tried doing the same

Show Helper text below EditText along with the Hint

拈花ヽ惹草 提交于 2019-12-03 06:10:12
I am trying to make something on these lines: I am able to show the hint using android:hint="Email Address" but unable to show the helper text - This will be your email username <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <EditText android:id="@+id/et_username" android:layout_width="match_parent" android:layout_height="wrap_content" android:ems="15" android:hint="Username" app:et_helper="Username is preferably your registered email"/> </android.support.design.widget.TextInputLayout>` What I am getting is only and no

Android EditText: Done instead of Enter or Word Wrap instead of Multi Line

只愿长相守 提交于 2019-12-03 06:08:18
I have a multiple line EditText that does not permit line returns. Right now I am replacing returns with some spaces as soon as they click save. Is there any way I can replace the on screen enter button with a Done button? (like it is for single line EditText) I am aware that I should still strip out returns ( \r\n|\r|\n ) because the on screen keyboard is not the only way to add them. Here is my current XML <EditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:minLines="3" android:gravity="left|top" android:inputType="textMultiLine|textAutoCorrect

Gboard: Enable GIF insertion on EditText

孤街醉人 提交于 2019-12-03 06:04:28
I am using the Gboard from Google in my app and when i input a GIF from the keyboard app to my EditText it then shows a toast "The text field does not support GIF insertion from the keyboard" I have search about this a thousand times and can't find out a result Any help would be appreciated. Image Keyboard Support Users often want to communicate with emojis, stickers, and other kinds of rich content. In previous versions of Android, soft keyboards (also known as input method editors or IMEs) could send only unicode emoji to apps. For rich content, apps had to either build app-specific APIs

How to dynamically set layout parameters in Android?

冷暖自知 提交于 2019-12-03 05:53:25
I have these text fields which I generated dynamically. But I can't seem to set layout parameters for them. Please tell me what I'm doing wrong. I'm able to generate the fields without layout parameters. However, If I use LayoutParams , it doesn't even get generated. Code: TableLayout table = (TableLayout) findViewById(R.id.TableLayout1); TableRow tr = new TableRow(this); LinearLayout.LayoutParams trparams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); tr.setLayoutParams(trparams); cg[i] = new EditText(this); weight[i] = new

How to customize the “chips” auto-suggesting mechanism, as used on Gmail's recipients field?

送分小仙女□ 提交于 2019-12-03 05:51:16
Background I've searched for a way to have a similar look & feel to the Gmail receipients field, which allows auto-filling of items in a really cool way: The class that is built into the Android framework and is responsible for this is called " MultiAutoCompleteTextView " . The problem the MultiAutoCompleteTextView is quite basic, yet it doesn't hold enough samples, tutorials and libraries to get to know how to customize it like on Gmail and the likes. I would like to know how to customize it to handle any kind of data, and that I will have full control over it (for example adding, deleting

How to make an EditText selectable but not editable on Android Ice Cream Sandwich?

╄→гoц情女王★ 提交于 2019-12-03 05:50:30
I have a ListView in Activity, and in each item , I insert an EditText for show my text. I need drag the handle to select text & copy the text, but can not edit text. On Android ICS, How can I do this? Frozen Crayon text.setTextIsSelectable(true) requires API 11. For those using lower API's: In xml use: android:inputType="none" android:textIsSelectable="true" This will make your EditText uneditable but selectable. I think you could override the onKeyDown() method, make it do nothing but return true. It should catch the keypresses from the keyboard and negate them before they can go into the

Android: Remove Enter Key from softkeyboard

落爺英雄遲暮 提交于 2019-12-03 05:40:16
In my login form when user clicks on an EditText and presses the enter key, this inserts a new line, therefore increasing the EditText's size. Next moment, it returns to its previous place and prints a dot in the password field (which is the next field). I want to remove this enter key from the softkeyboard. Is it possible? I am afraid you can't do this. But one thing is you can handle the softkeyboard keyevents like this, edittext.setOnKeyListener(new OnKeyListener() { public boolean onKey(View v, int keyCode, KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode

EditText loses focus when keyboard appears; requires touching twice to edit

只愿长相守 提交于 2019-12-03 05:38:42
问题 I have been designing an application which holds an expandable list. At the end of every list, an empty EditText is ready to receive comments. I have the following problem; when I touch the EditText , the screen resizes slightly (not a problem as the resizing does not always happen, depending on my layout and the position of the EditText int he list) and the soft-keyboard appears. However, during these events, the EditText loses focus and does not regain it. This is quite inconvenient as

onEditorAction() is not called after Enter key has been pressed on Jelly Bean emulator

馋奶兔 提交于 2019-12-03 05:38:07
I'm having a problem with the behavior of the latest Jelly Bean emulator. I have several EditTexts in my app. An OnEditorActionListener provides special handling when a user presses the ENTER key on the keyboard. This worked up until ICS, but now on Jelly Bean the listener callback method onEditorAction() no longer gets called. Only a new line is inserted into the EditText . This can be reproduced this way: EditText testEditText = new EditText(context); testEditText.setOnEditorActionListener(new OnEditorActionListener() { public boolean onEditorAction(TextView v, int actionId, KeyEvent event)