I have an input email that has background color normally and also when the email is incorrect it should show an error icon and a bottom red line but not a message under that. All is good but the problem is that I need to let error enabled all the time and it adds a bottom padding even though I don’t need to show any text on the bottom.
I cannot find a way how to remove that padding on the bottom.
Here is the code of my edit text:
<code><com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
style="@style/EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_18sdp"
android:hint="Email"
android:textColor="@color/darkColor"
app:boxBackgroundColor="@color/edit_text_color"
app:boxBackgroundMode="filled"
app:boxStrokeErrorColor="@color/dark_red"
app:boxStrokeWidth="0dp"
app:boxStrokeWidthFocused="0dp"
app:errorEnabled="true"
android:paddingBottom="0dp"
app:hintTextColor="@color/hint_color">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/emailEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="@font/roboto"
android:inputType="textEmailAddress"
android:textColor="@color/darkColor"
android:textSize="14sp"
app:hintTextColor="@color/hint_color"
tools:text="[email protected]" />
</com.google.android.material.textfield.TextInputLayout>
</code>
<code><com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
style="@style/EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_18sdp"
android:hint="Email"
android:textColor="@color/darkColor"
app:boxBackgroundColor="@color/edit_text_color"
app:boxBackgroundMode="filled"
app:boxStrokeErrorColor="@color/dark_red"
app:boxStrokeWidth="0dp"
app:boxStrokeWidthFocused="0dp"
app:errorEnabled="true"
android:paddingBottom="0dp"
app:hintTextColor="@color/hint_color">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/emailEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="@font/roboto"
android:inputType="textEmailAddress"
android:textColor="@color/darkColor"
android:textSize="14sp"
app:hintTextColor="@color/hint_color"
tools:text="[email protected]" />
</com.google.android.material.textfield.TextInputLayout>
</code>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
style="@style/EditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/_18sdp"
android:hint="Email"
android:textColor="@color/darkColor"
app:boxBackgroundColor="@color/edit_text_color"
app:boxBackgroundMode="filled"
app:boxStrokeErrorColor="@color/dark_red"
app:boxStrokeWidth="0dp"
app:boxStrokeWidthFocused="0dp"
app:errorEnabled="true"
android:paddingBottom="0dp"
app:hintTextColor="@color/hint_color">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/emailEditText"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fontFamily="@font/roboto"
android:inputType="textEmailAddress"
android:textColor="@color/darkColor"
android:textSize="14sp"
app:hintTextColor="@color/hint_color"
tools:text="[email protected]" />
</com.google.android.material.textfield.TextInputLayout>
And here is a picture of the selected edit text, where you can see the padding that enabled error is showing. How to remove that?