Custom EditText (hint goes up when clicked) xml code

PHOTO EMBED

Tue Dec 29 2020 06:45:03 GMT+0000 (Coordinated Universal Time)

Saved by @swalia ##kotlin,#java,#android

<com.google.android.material.textfield.TextInputLayout
                android:id="@+id/til_title"
                style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent">

                <androidx.appcompat.widget.AppCompatEditText
                    android:id="@+id/et_title"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="@string/edit_text_hint_title"
                    android:inputType="textCapWords"
                    android:textColor="@color/primaryTextColor"
                    android:textColorHint="@color/secondaryTextColor"
                    android:textSize="@dimen/edit_text_text_size" />
            </com.google.android.material.textfield.TextInputLayout>
content_copyCOPY

use materialComponents theme as your parent theme for the activity to be used in.