I would like to customise textfield in Android.
When login activity shows up it will display normal text field as shown below:
When user clicks on text field to input, text field should be displayed as:
How can I achieve this behaviour?
You should try with Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense
<com.google.android.material.textfield.TextInputLayout
style="@style/customInputLayoutStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<androidx.appcompat.widget.AppCompatEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Enter your valid phone" />
</com.google.android.material.textfield.TextInputLayout>
Then your customInputLayoutStyle will be
<style name="customInputLayoutStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense">
<item name="boxStrokeColor">@color/colorPrimary</item>
</style>