Remove extra padding on start of TextInputLayout

41 Views Asked by At

The start text of textinput layout is getting cut

Is it possible to remove the padding inside the textinput layout?

TextInput style

   <style name="Widget.TextInputLayoutx" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
        <item name="android:layout_marginBottom">?spacerSmall</item>
        <item name="android:layout_width">match_parent</item>
        <item name="android:layout_height">wrap_content</item>
        <item name="boxBackgroundMode">outline</item>
    </style>

Custom View for textinput layout

   <com.custom.android.design.amount.input.InputAmountView
        android:id="@+id/amountInputView"
        style="@style/Widget.TextInputLayoutx"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:textAlignment="viewStart"
        android:padding="0dp"
        android:layout_margin="0dp"
        android:paddingVertical="0dp"
        app:errorIconDrawable="@null"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@+id/tvCurrency"
        app:layout_constraintTop_toBottomOf="@id/amountTitle" />

The start text of textinput layout is getting cut

1

There are 1 best solutions below

0
Devesh Kumawat On
You can just set the start and end padding on the inner EditText to 0dp.

<com.google.android.material.textfield.TextInputLayout
  android:layout_width="match_parent"
  android:layout_height="wrap_content">

  <com.google.android.material.textfield.TextInputEditText
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingStart="0dp"
    android:paddingEnd="0dp" />

</com.google.android.material.textfield.TextInputLayout>