Skip to content

Commit

Permalink
[MaterialTimePicker] Fix layout getting cut on narrow screens
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 544436341
  • Loading branch information
paulfthomas authored and raajkumars committed Jul 5, 2023
1 parent 174a57d commit d10201d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:barrierMargin="@dimen/material_timepicker_dialog_buttons_margin_top"
app:constraint_referenced_ids="material_textinput_timepicker, material_timepicker_view" />

<com.google.android.material.timepicker.TimePickerView
android:id="@+id/material_timepicker_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/material_clock_face_margin_top"
android:layout_marginBottom="24dp"
android:layout_marginBottom="@dimen/material_clock_face_margin_bottom"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@+id/material_timepicker_mode_button"
app:layout_constraintTop_toTopOf="parent" />

<ViewStub
Expand All @@ -63,11 +56,12 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="44dp"
android:layout_marginBottom="24dp"
android:layout_marginBottom="@dimen/material_clock_face_margin_bottom"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@+id/material_timepicker_mode_button"
app:layout_constraintTop_toTopOf="parent" />

<com.google.android.material.button.MaterialButton
Expand All @@ -77,7 +71,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/barrier" />
app:layout_constraintBottom_toBottomOf="parent" />

<Button
android:id="@+id/material_timepicker_cancel_button"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
-->

<resources>
<dimen name="material_timepicker_dialog_buttons_margin_top">8dp</dimen>
<dimen name="material_clock_face_margin_bottom">8dp</dimen>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
-->

<resources>
<dimen name="material_timepicker_dialog_buttons_margin_top">24dp</dimen>
<dimen name="material_clock_face_margin_bottom">24dp</dimen>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<dimen name="material_clock_period_toggle_vertical_gap">12dp</dimen>
<dimen name="material_clock_face_margin_top">44dp</dimen>
<dimen name="clock_face_margin_start">64dp</dimen>
<dimen name="material_timepicker_dialog_buttons_margin_top">24dp</dimen>
<dimen name="material_clock_face_margin_bottom">24dp</dimen>
<dimen name="material_clock_hand_stroke_width">2dp</dimen>
<dimen name="material_clock_hand_padding">4dp</dimen>
<dimen name="material_clock_hand_center_dot_radius">4dp</dimen>
Expand Down

0 comments on commit d10201d

Please sign in to comment.