This is how you can achieve using material design TextFiled
- if you want more space between text and Image use
android:drawablePadding="16dp"
android:gravity="center"
- for round corner radius without out line border set style
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
Blockquote
if you want to achieve round coroner border set
app:boxCornerRadiusBottomEnd="32dp"
app:boxCornerRadiusBottomStart="32dp"
app:boxCornerRadiusTopEnd="32dp"
app:boxCornerRadiusTopStart="32dp"
Below are the code snippet
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
app:boxCornerRadiusBottomEnd="32dp"
app:boxCornerRadiusBottomStart="32dp"
app:boxCornerRadiusTopEnd="32dp"
app:boxCornerRadiusTopStart="32dp"
app:boxStrokeColor="@color/color_red"
app:startIconDrawable="@drawable/ic_user">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="16dp"
android:gravity="center"
android:hint="hint"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>