android-edittext

Continuous OTP input with EditText

血红的双手。 提交于 2020-01-22 03:10:13
问题 Here is 4 EditText for input a numeric password. I want it to be like, If first EditText is filled by 1 number then, focus should goes to next EditText and should also work same in reverse manner. So that user can keep entering password from Left most and can also erase same way from Right most. Can someone suggest what can be the best approach to proceed? 回答1: You can use the library Android PinView / OtpView or you can use addTextChangedListener to add a TextWatcher which is called whenever

Select edittexts text in a listview. How can be done? I can't find out

 ̄綄美尐妖づ 提交于 2020-01-21 05:19:05
问题 I have a ListView with an EditText on each row working. I need to select this text on click the edittext to write numbers without erasing or moving the cursor. Using selectAllonfocus at first works. However, after scrolling the listview, the EditText got crazy and selection doesn't work correctly. If I execute selectAll in the listener onFocus, then when a touch is made the contextmenu (select word, select all,etc) is shown instead of the selection. If someone can help. Thanks. 回答1: I can't

Android Get EditText Input Type At Runtime

痞子三分冷 提交于 2020-01-21 05:03:16
问题 I have a custom implementation of an edit text class. Based on these XML attribute..... android:inputType="textPersonName" android:inputType="textPersonName" android:inputType="textEmailAddress" android:inputType="textPassword" I want to be able to know this at run time (In Java Code) I have found this method which gives me the input type getInputType() And these are the values returned based on the XML I posted above. 97,97,33,129 However, these do not correspond to the constant values

Scrollable vertically and horizontally EditText that doesn't automatically break text to the next line

烂漫一生 提交于 2020-01-20 08:59:07
问题 I need an activity that look like a simple text editor: full-screen EditText with submit button below it. Important: 1. EditText has to scroll both vertically and horizontally 2. Input text goes to the next line ONLY when the user clicks nextline button 3. EditText fills the whole space between the top of the screen and the button My code: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"

How can I detect focused EditText in android?

扶醉桌前 提交于 2020-01-19 07:10:16
问题 I have a number of EditText s in my page along with two buttons. I want the user to touch on any one EditText field and click any button to insert a certain value into that very EditText field he touched. Giving input using keypad is not allowed. Please help me to do this. 回答1: One thing that you can do is declare a global variable evalue which will tell you which is the last selected EditText by using onTouchListener and then based on the value of evalue , you can set the text value to the

How can I detect focused EditText in android?

百般思念 提交于 2020-01-19 07:09:29
问题 I have a number of EditText s in my page along with two buttons. I want the user to touch on any one EditText field and click any button to insert a certain value into that very EditText field he touched. Giving input using keypad is not allowed. Please help me to do this. 回答1: One thing that you can do is declare a global variable evalue which will tell you which is the last selected EditText by using onTouchListener and then based on the value of evalue , you can set the text value to the

How to hide underbar in EditText

我的梦境 提交于 2020-01-18 11:12:09
问题 How can I hide the EditText underbar (the prompt line with little serifs at the ends)? There might be a better way to do what I want: I have a layout with an EditText. Normally, this displays fine where the user can tap on it and begin entering or editing text. Sometimes, however, I would like to use the same layout (simplifies other logic) to display the same data in a read-only manner. I want the presentation to be similar - it should have the same height and same font, but not have the

How to hide underbar in EditText

一世执手 提交于 2020-01-18 11:10:44
问题 How can I hide the EditText underbar (the prompt line with little serifs at the ends)? There might be a better way to do what I want: I have a layout with an EditText. Normally, this displays fine where the user can tap on it and begin entering or editing text. Sometimes, however, I would like to use the same layout (simplifies other logic) to display the same data in a read-only manner. I want the presentation to be similar - it should have the same height and same font, but not have the

How to hide underbar in EditText

萝らか妹 提交于 2020-01-18 11:10:20
问题 How can I hide the EditText underbar (the prompt line with little serifs at the ends)? There might be a better way to do what I want: I have a layout with an EditText. Normally, this displays fine where the user can tap on it and begin entering or editing text. Sometimes, however, I would like to use the same layout (simplifies other logic) to display the same data in a read-only manner. I want the presentation to be similar - it should have the same height and same font, but not have the

Is it possible to replace dots in password (EditText) with custom view?

给你一囗甜甜゛ 提交于 2020-01-17 05:09:08
问题 I want to replace dots in EditText ( android:inputType="textPassword" ) with custom xml or image. I can replace dots with any other symbol using PasswordTransformationMethod method, but this is not what is required in this case. So, is it possible? Thanks. 回答1: There is Span API for Edit text. You could use TextWatcher in connection with ImageSpan. Also Don't forget about copy/paste functionalty in secure reson. So solution is listening text input, and wrap it with ImageSpans. when you want