I have in a Android Application, a DialogFragment that is show, when I click on FloatingActionButton.
Now, this is the xml file of DialogFragment:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:focusable="true"
android:focusableInTouchMode="true">
<TextView
android:id="@+id/labelStartDate"
android:layout_width="150dp"
android:layout_height="150dp"
android:gravity="left|center"
android:padding="15dp"
android:text="@string/start_date"/>
<DatePicker
android:id="@+id/startDate"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:layout_toRightOf="@id/labelStartDate"
android:calendarViewShown="false"
android:datePickerMode="spinner"
android:endYear="2100"
android:startYear="1900"
>
</DatePicker>
<TextView
android:id="@+id/labelEndDate"
android:layout_width="150dp"
android:layout_height="150dp"
android:gravity="left|center"
android:padding="15dp"
android:layout_below="@id/labelStartDate"
android:text="@string/end_date"/>
<DatePicker
android:id="@+id/endDate"
android:layout_width="wrap_content"
android:layout_height="150dp"
android:calendarViewShown="false"
android:datePickerMode="spinner"
android:layout_toRightOf="@id/labelEndDate"
android:layout_below="@id/labelStartDate"
android:paddingTop="10dp"
android:endYear="2100"
android:startYear="1900"
>
</DatePicker>
......
</RelativeLayout>
In my Fragment, I open the DialogFragment in this mode:
FloatingActionButton button = (FloatingActionButton) v.findViewById(R.id.add_button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
AlertsDialogFragment dialog = AlertsDialogFragment.newInstance();
dialog.show(getActivity().getFragmentManager(),"");
}
});
Now, whit this code, I'm able to display the Dialogfragment, but now I have two problems:
1) If I show, the Dialog, then I click on another point on the view, the Dialog is hide. 2) If I click on fourth (for example) editText, I can't click on the next EditText, and I must hide keyboard, then click on edittext...
EDIT
For the second point, when I display the DialogFragment, I see this:
But if I click on the Reaction Text, I can't see the text Status as you can see from this image: