Skip to content

Commit

Permalink
Workaround layout problems with Material Design
Browse files Browse the repository at this point in the history
In some contexts (e.g. BottomSheetDialogFrament), Material Design
themes will override the default of singleLine=false to true. This
causes layout problems because the forward/rewind buttons are no
longer visible with singleLine=true.

This problem can be avoided by explicitly requesting the default
value of false in our layout files.

Issue: #511

#minor-release

PiperOrigin-RevId: 582604131
  • Loading branch information
tonihei authored and Copybara-Service committed Nov 15, 2023
1 parent bd7615c commit 310e2ed
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
`MediaMetadata.extras`
([#756](https://github.com/androidx/media/issues/756)).
* UI:
* Fix issue where forward and rewind buttons are not visible when used
with Material Design in a BottomSheetDialogFragment
([#511](https://github.com/androidx/media/issues/511)).
* Downloads:
* OkHttp Extension:
* Cronet Extension:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">

<!-- Override of singleLine needed to avoid layout bugs with Material Design.
See https://github.com/androidx/media/issues/511.
-->
<Button android:id="@+id/exo_ffwd_with_amount"
android:singleLine="false"
style="@style/ExoStyledControls.Button.Center.FfwdWithAmount"/>
</merge>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">

<!-- Override of singleLine needed to avoid layout bugs with Material Design.
See https://github.com/androidx/media/issues/511.
-->
<Button android:id="@+id/exo_rew_with_amount"
android:singleLine="false"
style="@style/ExoStyledControls.Button.Center.RewWithAmount"/>
</merge>
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@
android:addStatesFromChildren="true"
style="@style/ExoStyledControls.Button.Center">
<!-- View's don't have foreground until API 23 so we have to nest in a parent. -->
<!-- Override of singleLine needed to avoid layout bugs with Material Design.
See https://github.com/androidx/media/issues/511.
-->
<Button android:id="@id/exo_ffwd_with_amount"
android:background="@drawable/exo_styled_controls_fastforward"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:singleLine="false"
style="@style/ExoStyledControls.Button.Center.FfwdWithAmount"/>

</FrameLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@
android:addStatesFromChildren="true"
style="@style/ExoStyledControls.Button.Center">
<!-- View's don't have foreground until API 23 so we have to nest in a parent. -->
<!-- Override of singleLine needed to avoid layout bugs with Material Design.
See https://github.com/androidx/media/issues/511.
-->
<Button android:id="@id/exo_rew_with_amount"
android:background="@drawable/exo_styled_controls_rewind"
android:layout_marginLeft="0dp"
android:layout_marginRight="0dp"
android:singleLine="false"
style="@style/ExoStyledControls.Button.Center.RewWithAmount"/>

</FrameLayout>
Expand Down

0 comments on commit 310e2ed

Please sign in to comment.