Tag: android-edittext

EditText: Differentiate between text change by setText() or by keyboard input

I have an EditText View which is edited by setText() from my code and by the user via (soft/hard) keyboard and – if possible by speech input. I want to handle input made by my code in another way than normal user input: if a user input happens, a internal event shall be fired. But […]

Custom Keyboard: handling inputType change

I am running into an issue that I can’t figure out. I wrote a simple custom IME keyboard based on this sample. It basically has two custom keyboards, one for letters and one for numbers. They use different layouts. However, when I add two EditText controls one for text and one for numbers, the keyboard […]

EditText and TabHost do not like each other

I have a layout with EditText and TabHost containing 2 tabs. Android 1.6. I use hardware keyboard in following case. Steps to reproduce: When activity is displayed the EditText gains focus. As soon as I press any key the EditText loses focus and first tab gains it. I click on the EditText again and start […]

Android material chips

I want to implement an autocomplete edittext with chips in my application and I want to do it in a way that it’s done here: material design chips. First I would like to ask if there is some kind of widget (maybe as part of the new support library) or a solution that I can […]

Android show EditText.setError() above the EditText and not below it

When i call EditText.setError(); the error appears below the edittext, and makes it impossible to interact with the View below the EditText. Is it possible to show the error above the EditText? Google doesn’t seem to have the answer(Or i’m using wrong search terms).

android EditText ,keyboard textWatcher problem

I am working on a android app and I have an EditText where user can input numbers. I want to format the number using different currency formats (say ##,##,###) and I want to do it on the fly, ie when user enter each digit(not when enter is pressed). I googled around, and came across TextWatcher […]

EditTextPreference and default cursor position

This is mostly a pet peeve of mine, but it annoys me to no end that the default behavior or EditTextPreferences is to put the cursor at the beginning of the string. This makes NO sense at all to me. In almost any other interface known to man (fine, ME), focusing on a textfield automatically […]

Add drop shadow effects to EditText Field

I am trying to design an EditText Field having Shadows (bottom and right side) like this tried googling & hunted many SO discussions but all are for TextView not EditText. This is my code adding shadow to Input Text but not to TextField <EditText android:id=”@+id/txtpin” android:maxLength=”4″ android:layout_marginLeft=”10dp” android:layout_height=”37dp” android:gravity=”center_horizontal” android:inputType=”textPassword” android:longClickable=”false” android:layout_width=”160dp” android:shadowColor=”@color/Black” android:shadowDx=”1.2″ android:shadowDy=”1.2″ […]

EditText Alternatives in a Widget? There has to be a way

Has anyone ever successfully implemented an EditText in a widget? I realize Android does not support this, however, “Friend Stream” on HTC devices does it… Is this due to an HTC feature? Could I implement this on HTC? Anyone have any crazy creative ideas for implementing a textbox which actually allows typing on a homescreen […]

Change thickness of the bottom line of EditText when wrapped into TextInputLayout

here is my code XML Markup <android.support.design.widget.TextInputLayout android:layout_width=”match_parent” android:layout_height=”wrap_content” android:theme=”@style/TextLabel”> <EditText android:id=”@+id/etContactName” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:hint=”Contact Name”/> </android.support.design.widget.TextInputLayout> Style <style name=”TextLabel” parent=”TextAppearance.AppCompat”> <item name=”android:textColorHint”>@color/hintColor</item> <item name=”colorAccent”>@color/primaryColor</item> <item name=”colorControlNormal”>@color/hintColor</item> <item name=”colorControlActivated”>@color/primaryColor</item> </style> Here is the output (normal view) (focused view) Now My Problems / Issues I want the bottom line to be thinner. where should I change […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.