I'm trying to create something like this in my app(taken from google docs):
Now, I tried to create a TextInputLayout
element and try to put border around it but I can't manage to get this to look like the images I posted.
Here is my code for the TextInputLayout
:
<android.support.design.widget.TextInputLayout
android:id="@+id/shipper_layout"
android:layout_width="match_parent"
android:layout_height="150dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/text_layout_stroke_normal"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp">
<EditText
android:id="@+id/shipper_field"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="15dp"
android:background="@null"
android:gravity="top"
android:hint="@string/shipper_field"
android:inputType="textMultiLine"
android:overScrollMode="always"
android:scrollbarStyle="insideInset"
android:scrollbars="vertical" />
</android.support.design.widget.TextInputLayout>
Here is how it looks: (Before focused)
You can see the border isn't change as expected and the hint is just minimized