I am using the setError method of the EditText view. The problem is, I want the EditText text to only be filled up to a certain point, so I need to put a padding on it's right side. But then the error icon is also pushed by the padding. Is there any way to prevent this?
It turns out there's no workaround for this. I just changed the logic of my custom edittext to add padding ONLY if the error icon is not shown
Related
Screenshot
The problem appears only if the layout is added through WindowManager.addView
How to remove it? If this is a suggestion then how to make the text visible?
android:popupBackground didn't help
1.What is the use of android:hintAnimationEnabled in TextInputLayout?
2.What is the difference between android:hintAnimationEnabled and android:hintEnabled?
1.What is the use of android:hintAnimationEnabled in TextInputLayout?
When you click (focus) on an empty EditText with hint, the hint text animates and slides upwards. android:hintAnimationEnabled allows you to enable or disable this animation.
Check the image below:
2.What is the difference between android:hintAnimationEnabled and android:hintEnabled?
android:hintEnabled was added in design library 23.2.0.
android:hintEnabled="true" (Enabled) : Shows the hint floating on the top of EditText when focused or when having text set into the EditText
android:hintEnabled="false" (Disabled) : Doesn't show the hint floating on top of EditText, it means, the hint is visible at the same place when empty EditText is focussed and vanishes off as soon as the first character is entered.
In short, android:hintAnimationEnabled enables/disables the hint animation while android:hintEnabled enables/disables the floating behaviour of hint.
Have a look at this. It has a clear view of TextInputLayout hintAnimation
https://www.journaldev.com/14748/android-textinputlayout-example
UPDATE
When you set a hint in TextInputLayout is shows as like as a normal textView Hint. But when user click on EditText the hint slide and goes little upwards.
And , if you disable hint animation, then it won't show any animation for hint text.
I'll give you a hint ;)
Animation is a different property than the Hint text being there at all
In other words, you can't animate something that's disabled. But you don't need animation to show the value
You're welcome to read what the difference is. https://developer.android.com/reference/android/support/design/widget/TextInputLayout.html
I have an EditText using a background with a big height, when I click on my EditText, the screen shifts up to show the soft keyboard, but not the entire EditText stays visible. The bottom part of the Edit Text background disappears because the soft keyboard goes up in it.
I need that my screen shifts up a little more! How could I do that?
Tks,
I think its better to use a ScrollView.
Using this will shift the entire screen up.
Try it out once
Create a empty layout and put it at the bottom of the screen by property align parent bottom set to true.
Now set your edittext above it. Add property layout_above and pass the id of the layout.
Now in the manifest, add screensize to config changes attribute for that activity or in the application tag
I have a little issue with the keyboard on my numberpicker.
It's kinda hard to explain in words so here are some screenshots:
When I click on the numberpicker the keyboard shows up:
When I click on the next button (in this case the 'Volg' button) I implemented that it should focus the next edittext.
But as you can see, the screen shifts a little to the top.
This is not a huge problem but it's kinda annoying.
What can cause this, or how can I fix this ?
Edit: the layout is a scrollview.
try this
In your manifest file under activity tag use attribute
android:windowSoftInputMode="stateUnchanged"
I would like to have an EditText with one modification: on the right but still inside the EditText there should an arrow pointing downwards that I can set OnClickListener to so that when the user clicks on the arrow it displays a menu.
What is the best way to do this?
Do you mean something like this ?
see image
Add the arrow by setting the drawable right attribute
android:drawableRight="#drawable/right"
to your EditText. Then you would need to set an OnTouchListener to get the events.
I did this by putting EditText and a Button into RelativeLayout, the Button (which has custom background drawable) is overlapping the EditBox.
When user clicks on it, the EditBox doesn't receive the click event.
Sounds like a combo box. If you look at the "Building Custom Components" section of the Dev Guide, they mention combo box briefly, but give details on how to build any custom component.