This question already has answers here:
Unable to use drawable in EditText inside TextInputLayout
(5 answers)
Closed 6 years ago.
I am using code bellow to display User name Input. EditText is working properly but Right side display icon is not visible.
<android.support.design.widget.TextInputLayout
android:id="#+id/login_screen_edit_text_username_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.TextInputEditText
android:id="#+id/login_screen_edit_text_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="#string/label_username"
android:inputType="text"
android:drawableRight="#mipmap/email_icon"
android:text="abcd#gmail.com"
/>
</android.support.design.widget.TextInputLayout>
I am testing this code on Nexus6p android version 6.0. Parent layout is LinearLayout.Please update if anybody facing same issue and got fix for it.
use
android:drawableEnd="#mipmap/email_icon"
instead of
android:drawableRight="#mipmap/email_icon"
Related
This question already has answers here:
Android EditText with different floating label and placeholder
(8 answers)
Closed 2 years ago.
var tel_text = "Enter your phone number"
Consider that the edittext is tel_text with a large font. When the user starts writing this article in edittext, I want it to be animated from bottom to top. How can I customize Edittext the easiest?
It looks like you want to add a hint to it which animates to the top when user begins to type. Wrap it inside TextInputLayout
<android.support.design.widget.TextInputLayout
android:id="#+id/edt_hint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter your phone number">
<EditText
android:id="#+id/edit"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
This question already has answers here:
Set FAB icon color
(18 answers)
Closed 4 years ago.
I am using one of the preset button designs (an add button) for my FAB. I was able to change the colour of the background colour of the button but the plus is green and I want to change that. How can I change that?
Using
android:tint
property you can set the color like this
<android.support.design.widget.FloatingActionButton
android:id="#+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:tint="#android:color/white"
android:src="#android:drawable/ic_input_add" />
Hope this helps. Good luck :)
This question already has answers here:
Android RTL password fields?
(6 answers)
Closed 6 years ago.
I'm facing an issue that when I define an EditText as password type and view my screen in Arabic language the password field hint text is showing on the left side instead of right side [that is expected].
Above is the result I get. I need password hint text to be starting from the right side that's where Arabic writings start. I've also tried adding text gravity to it but no luck.
Please refer to this post :
Android RTL password fields?
For API 17+ you can use
android:textAlignment="viewStart"
Try this:
<EditText
android:id="#+id/input_password"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:hint="كلمة المرور"
android:textColorHint="#FFFFFF"
android:gravity="right"
android:inputType="textPassword"
android:background="#null"
android:textColor="#FFFFFF"
android:textSize="20dp"/>
This question already has answers here:
android prevent EditText from requesting focus automatically [duplicate]
(3 answers)
Closed 7 years ago.
I have a layout with a single TextInputLayout with an EditText inside it.
When the layout is loaded the EditText is immediately in edit mode, the keyboard is not up but the cursor is blinking and the hint is not inside the EditText but above it.
I want the hint to be animated out of the EditText only the the use first clicks the EditText.
How can I accomplish that? I have tried clearFocus() on both the EditText and the TextInputLayout.
My xml:
<android.support.design.widget.TextInputLayout
android:id="#+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">
<EditText
android:singleLine="true"
android:id="#+id/case_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Case name" >
</EditText>
</android.support.design.widget.TextInputLayout>
try this
editText.setCursorVisible(false)
This question already has answers here:
TextInputLayout not showing EditText hint before user focus on it
(17 answers)
Closed 7 years ago.
Below is the code that I am using. TextInputLayout is included as a part of Androids new Design library. But it does show the hint inside of the EditText. Am I using this the wrong way?
Once I click on the EditText the hint text animation works properly. Also when I click on some other EditText the hint text returns properly. So that is also not an issue. But I am not able to view the hint text in the first place.
<android.support.design.widget.TextInputLayout
android:id="#+id/tilDrugName"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="#+id/edtDrugName"
style="#style/ETPrescription"
android:hint="#string/drug_name"/>
</android.support.design.widget.TextInputLayout>
As far as I have come across, this has been a bug in Android Support library for design.
Android Source Bug
So I think this will be resolved in upcoming updates.