How to give extra left padding to floating label in TextInputLayout android - android

My requirement is that I need to display the floating label on an Outlined TextInput Box a little to the right of the underlying EditText text value
Something like this-
See how the label Notes is a little to the right of Enter/View Notes. I tried to use hintTextAppearance attribute in the styles with paddingStart but the padding is just ignored.
Is there a way to customize the label's margin/padding to set the label a little towards right?

Related

How to change left margin / padding text error on android TextInputLayout material.textfield

I need to remove error text left padding / margin on TextInputLayout material.textfield.
Any idea how to do this?
need like this error text with no padding
Default padding is same with TextInputEditText padding (has left padding):
I try extend IndicatorViewController but it final class
Well, I did say I am relatively new to this, I assumed that you would be able to modify the padding attributes within the theme. I did find another solution possibly but it brings both the floating label and the error text over. It would need to be setup dynamically but messing with
textInputLayout.setPadding(-40,0,0,0);
changed it so that it would line up closer to the left margin.

Aligned TextInputLayout text to the right

I have a EditText within a TextInputLayout. The EditText text floats to the right. I want the TextInputLayout to follow suit. Using android:gravity="right" on the EditText the text aligns to the right, but this doesn't work on TextInputLayout.
Any advice how to get the TextInputLayout text to float to the right?
This is not even possible when you have RTL support, and you select Arabic/Hebrew language.
The hint will float to left side instead of right side!

How to make the floating label under the text in TextInputLayout?

The TextInputLayout widget support floating label for EditText(check this post here), but default the floating label is above the text.
But I want to make the label under the text like this, how to do it???
Refer Android Floating Label EditText
http://www.truiton.com/2015/06/android-floating-label-edittext/

TextView with custom font isn't centered vertically

I need to use a custom font (VAG Rounded, probably not relevant) but the font changes how my TextViews react.
In the image below, you can see the two textviews with a black background. The left one use the custom font, the right one the default system font (Roboto ?). Both of them have the same xml properties and size, but the padding is not the same and more important, the left one isn't centered vartically !
How can I make the TextView draw its content well centered ?
You can try to remove your customs font padding from your text style (styles.xml):
<item name="android:includeFontPadding">false</item>
If this still doesn't work, i would set a general padding in your styles xml.
I think that you have to set android:layout_height="match_parent" and then also android:gravity="center"
then if you post also your source code we can give you more information
I could not change the font, and I wasn't going to edit each character using an editor (I don't even know what I should have done to fix it).
Si I ended up measure the difference with the default font and I added 0.15f * fontSize in the padding top...

Centering text inside the label view of the android actionbar

This is the label of my activity in the actionbar with "Show layout bounds" option enabled.
As you can see the label area is centered, but the text inside it is moved to bottom. So it appears like the text is not centered.
How to center the text vertically?
You should provide some additional information like the definition of the layout.xml file.

Categories

Resources