So, I use TextInputLayout and EditText to input email, but I have some trouble with hint placement. I also don't know how to change the color of this "I" symbol. Here is my XML for this email field:
<com.google.android.material.textfield.TextInputLayout
style="@style/ThemeOverlay.Material3.AutoCompleteTextView.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textColorHint="@color/black"
app:hintTextColor="@color/black"
app:boxStrokeColor="@color/black">
<EditText
android:layout_width="350dp"
android:layout_height="wrap_content"
android:hint="@string/test_email"
android:textSize="20sp"
android:id="@+id/logEmail"
android:layout_gravity="center"
android:inputType="textEmailAddress"
android:layout_marginTop="20dp"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:textColorHint="#616161"/>
</com.google.android.material.textfield.TextInputLayout>
Couple of mistakes here:
com.google.android.material.textfield.TextInputLayout
.android:hint="@string/test_email"
is used at wrong place.Use code below:
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:hint="app"
app:cursorColor="@android:color/holo_red_dark"
app:hintEnabled="true">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/logEmail"
android:layout_width="350dp"
android:layout_height="wrap_content"
android:inputType="textEmailAddress" />
</com.google.android.material.textfield.TextInputLayout>
In the code above:
app:cursorColor
to define caret (the "|" thing) color.