Skip to content

Commit

Permalink
[DatePicker] Wrapped text fields from range picker selection in a Scr…
Browse files Browse the repository at this point in the history
…ollView so their heights don't change in landscape mode.

PiperOrigin-RevId: 408333813
  • Loading branch information
leticiarossi authored and drchen committed Nov 10, 2021
1 parent 250d56d commit 9b5356f
Showing 1 changed file with 39 additions and 35 deletions.
Expand Up @@ -14,45 +14,49 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="@dimen/mtrl_calendar_content_padding"
android:paddingRight="@dimen/mtrl_calendar_content_padding"
android:orientation="horizontal">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/mtrl_picker_text_input_range_start"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">

<com.google.android.material.textfield.TextInputEditText
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingLeft="@dimen/mtrl_calendar_content_padding"
android:paddingRight="@dimen/mtrl_calendar_content_padding"
android:orientation="horizontal">

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/mtrl_picker_text_input_range_start"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/mtrl_picker_text_input_date_range_start_hint"
android:inputType="date"
android:imeOptions="flagNoExtractUi"/>
</com.google.android.material.textfield.TextInputLayout>

<Space
android:layout_width="8dp"
android:layout_height="0dp"/>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/mtrl_picker_text_input_range_end"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1">

<com.google.android.material.textfield.TextInputEditText
android:layout_weight="1">

<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/mtrl_picker_text_input_date_range_start_hint"
android:inputType="date"
android:imeOptions="flagNoExtractUi"/>
</com.google.android.material.textfield.TextInputLayout>

<Space
android:layout_width="8dp"
android:layout_height="0dp"/>

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/mtrl_picker_text_input_range_end"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/mtrl_picker_text_input_date_range_end_hint"
android:inputType="date"
android:imeOptions="flagNoExtractUi"/>
</com.google.android.material.textfield.TextInputLayout>

</LinearLayout>
android:layout_weight="1">

<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/mtrl_picker_text_input_date_range_end_hint"
android:inputType="date"
android:imeOptions="flagNoExtractUi"/>
</com.google.android.material.textfield.TextInputLayout>

</LinearLayout>
</ScrollView>

0 comments on commit 9b5356f

Please sign in to comment.