I use a material collector to create a form. If I use TextView, it works well, but I want to use EditText for it, I upload an image that you can see if I use EditText, how it looks, and if I use TextView, how it looks. But when using EditText I need to double click to open the DatePicker. For the first click, it behaves like an editable text field.
<ProgressBar android:id="@+id/payment_method_progress" style="?android:attr/progressBarStyleLarge" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="8dp" android:visibility="gone" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/adding_payment_method_heading" android:textSize="@dimen/activity_heading" android:elevation="0dp" android:layout_marginBottom="@dimen/activity_vertical_margin" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/adding_payment_method_description" android:textSize="@dimen/activity_description" android:elevation="0dp" android:layout_marginBottom="@dimen/activity_vertical_margin" /> <ScrollView android:id="@+id/adding_payment_method_view" android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:id="@+id/adding_payment_method_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/layout_user_id" > <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/enter_user_name" android:inputType="text" android:maxLines="1" android:singleLine="true" android:id="@+id/user_id" /> </android.support.design.widget.TextInputLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="left" android:layout_weight="1" android:text="Select Payment Methods" /> <Spinner android:id="@+id/payment_methods" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="right" android:layout_weight="1" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:id="@+id/check_chosen" > <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/layout_amount" > <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/amount" android:inputType="numberDecimal" android:maxLines="1" android:singleLine="true" android:id="@+id/amount" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/layout_check_number" > <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/check_number" android:inputType="number" android:maxLines="1" android:singleLine="true" android:id="@+id/check_number" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/layout_bank_name" > <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/bank_name" android:inputType="text" android:maxLines="1" android:singleLine="true" android:id="@+id/bank_name" /> </android.support.design.widget.TextInputLayout> <android.support.design.widget.TextInputLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/date_of_check" android:layout_weight="1" > <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/check_date" android:hint="Date" android:inputType="date" /> </android.support.design.widget.TextInputLayout> </LinearLayout> <android.support.design.widget.TextInputLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/layout_payment_info" > <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/payment_info" android:inputType="text" android:maxLines="1" android:singleLine="true" android:id="@+id/payment_info" /> </android.support.design.widget.TextInputLayout> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/payment_date" android:hint="@string/payment_date" android:inputType="date" /> <Button android:id="@+id/add_payment_method_action" style="?android:textAppearanceSmall" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="16dp" android:text="@string/submit" android:onClick="testSubmit" android:textStyle="bold" /> </LinearLayout> </ScrollView> </LinearLayout>

Please let me know if I need to post Java code here.
source share