mirror of
https://github.com/samsonjs/media.git
synced 2026-03-26 09:35:47 +00:00
Update Styled non bottom buttons to be borderless.
This requires the parent of the background to draw and have padding large enough to support the size of the ripple. The bottom buttons must remained bordered as the space around them is constrained. PiperOrigin-RevId: 350590722
This commit is contained in:
parent
1057f2e455
commit
eded1ca106
15 changed files with 153 additions and 110 deletions
|
|
@ -11,8 +11,7 @@
|
|||
* Add `LiveConfiguration` to `MediaItem` to allow media-specific live
|
||||
offset and live playback speed settings. The same settings can be set
|
||||
for all `MediaItems` in `DefaultMediaSourceFactory`.
|
||||
* Add `targetLiveOffsetUs` parameter to
|
||||
`LoadControl.shouldStartPlayback`.
|
||||
* Add `targetLiveOffsetUs` parameter to `LoadControl.shouldStartPlayback`.
|
||||
* Verify correct thread usage in `SimpleExoPlayer` by default. Opt-out is
|
||||
still possible until the next major release using
|
||||
`setThrowsWhenUsingWrongThread(false)`
|
||||
|
|
@ -71,13 +70,14 @@
|
|||
enough space.
|
||||
* Update StyledPlayer's control overlay scrim from 30% opacity to 60%
|
||||
opacity for Accessibility requirements.
|
||||
* Switch `StyledPlayerControlView` button controls to borderless ripples.
|
||||
* DRM:
|
||||
* Fix playback failure when switching from PlayReady protected content to
|
||||
Widevine or Clearkey protected content in a playlist.
|
||||
* Downloads:
|
||||
* Fix crash in `DownloadManager` that could occur when adding a stopped
|
||||
download with the same ID as a download currently being removed
|
||||
([#8419](https://github.com/google/ExoPlayer/issues/8419)).
|
||||
* Fix crash in `DownloadManager` that could occur when adding a stopped
|
||||
download with the same ID as a download currently being removed
|
||||
([#8419](https://github.com/google/ExoPlayer/issues/8419)).
|
||||
* Analytics:
|
||||
* Pass a `DecoderReuseEvaluation` to `AnalyticsListener`'s
|
||||
`onVideoInputFormatChanged` and `onAudioInputFormatChanged` methods. The
|
||||
|
|
|
|||
|
|
@ -571,9 +571,16 @@ import java.util.List;
|
|||
styledPlayerControlView.getHeight()
|
||||
- styledPlayerControlView.getPaddingBottom()
|
||||
- styledPlayerControlView.getPaddingTop();
|
||||
|
||||
int centerControlWidth =
|
||||
getWidthWithMargins(centerControls)
|
||||
- (centerControls != null
|
||||
? (centerControls.getPaddingLeft() + centerControls.getPaddingRight())
|
||||
: 0);
|
||||
|
||||
int defaultModeMinimumWidth =
|
||||
Math.max(
|
||||
getWidthWithMargins(centerControls),
|
||||
centerControlWidth,
|
||||
getWidthWithMargins(timeView) + getWidthWithMargins(overflowShowButton));
|
||||
int defaultModeMinimumHeight =
|
||||
getHeightWithMargins(centerControls) + 2 * getHeightWithMargins(bottomBar);
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2020 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/exo_gray">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/exo_white" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/background"
|
||||
android:drawable="@drawable/exo_styled_controls_fastforward" />
|
||||
</ripple>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2020 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<layer-list>
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/exo_gray_ripple"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="@drawable/exo_styled_controls_fastforward"/>
|
||||
</layer-list>
|
||||
</item>
|
||||
<item android:drawable="@drawable/exo_styled_controls_fastforward" />
|
||||
</selector>
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright 2020 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<layer-list>
|
||||
<item>
|
||||
<shape>
|
||||
<solid android:color="@color/exo_gray_ripple"/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="@drawable/exo_styled_controls_rewind"/>
|
||||
</layer-list>
|
||||
</item>
|
||||
<item android:drawable="@drawable/exo_styled_controls_rewind" />
|
||||
</selector>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2020 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<Button android:id="@+id/exo_ffwd_with_amount"
|
||||
style="@style/ExoStyledControls.Button.Center.FfwdWithAmount"/>
|
||||
</merge>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2020 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<Button android:id="@+id/exo_rew_with_amount"
|
||||
style="@style/ExoStyledControls.Button.Center.RewWithAmount"/>
|
||||
</merge>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2020 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="0dp"
|
||||
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. -->
|
||||
<Button android:id="@+id/exo_ffwd_with_amount"
|
||||
android:background="@drawable/exo_styled_controls_fastforward"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="0dp"
|
||||
style="@style/ExoStyledControls.Button.Center.FfwdWithAmount"/>
|
||||
|
||||
</FrameLayout>
|
||||
</merge>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2020 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="0dp"
|
||||
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. -->
|
||||
<Button android:id="@+id/exo_rew_with_amount"
|
||||
android:background="@drawable/exo_styled_controls_rewind"
|
||||
android:layout_marginLeft="0dp"
|
||||
android:layout_marginRight="0dp"
|
||||
style="@style/ExoStyledControls.Button.Center.RewWithAmount"/>
|
||||
|
||||
</FrameLayout>
|
||||
</merge>
|
||||
|
|
@ -119,23 +119,25 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout android:id="@+id/exo_center_controls"
|
||||
<LinearLayout
|
||||
android:id="@+id/exo_center_controls"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center">
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/exo_styled_controls_padding">
|
||||
|
||||
|
||||
<ImageButton android:id="@+id/exo_prev"
|
||||
style="@style/ExoStyledControls.Button.Center.Previous"/>
|
||||
|
||||
<Button android:id="@+id/exo_rew_with_amount"
|
||||
style="@style/ExoStyledControls.Button.Center.RewWithAmount"/>
|
||||
<include layout="@layout/exo_styled_player_control_rewind_button" />
|
||||
|
||||
<ImageButton android:id="@+id/exo_play_pause"
|
||||
style="@style/ExoStyledControls.Button.Center.PlayPause"/>
|
||||
|
||||
<Button android:id="@+id/exo_ffwd_with_amount"
|
||||
style="@style/ExoStyledControls.Button.Center.FfwdWithAmount"/>
|
||||
<include layout="@layout/exo_styled_player_control_ffwd_button" />
|
||||
|
||||
<ImageButton android:id="@+id/exo_next"
|
||||
style="@style/ExoStyledControls.Button.Center.Next"/>
|
||||
|
|
|
|||
18
library/ui/src/main/res/values-v21/dimens.xml
Normal file
18
library/ui/src/main/res/values-v21/dimens.xml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2016 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<resources>
|
||||
<dimen name="exo_styled_controls_padding">24dp</dimen>
|
||||
</resources>
|
||||
|
|
@ -14,13 +14,10 @@
|
|||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="@color/exo_gray">
|
||||
<item android:id="@android:id/mask">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/exo_white" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:id="@android:id/background"
|
||||
android:drawable="@drawable/exo_styled_controls_rewind" />
|
||||
</ripple>
|
||||
<resources>
|
||||
<style name="ExoStyledControls.Button.Center">
|
||||
<item name="android:layout_width">@dimen/exo_icon_size</item>
|
||||
<item name="android:layout_height">@dimen/exo_icon_size</item>
|
||||
<item name="android:background">?android:attr/selectableItemBackgroundBorderless</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
@ -15,8 +15,6 @@
|
|||
limitations under the License.
|
||||
-->
|
||||
<resources>
|
||||
<color name="exo_gray">#808080</color>
|
||||
<color name="exo_gray_ripple">#80808080</color>
|
||||
<color name="exo_white">#ffffff</color>
|
||||
<color name="exo_white_opacity_70">#B3ffffff</color>
|
||||
<color name="exo_black_opacity_70">#B3000000</color>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
<dimen name="exo_styled_bottom_bar_height">60dp</dimen>
|
||||
<dimen name="exo_styled_bottom_bar_time_padding">10dp</dimen>
|
||||
<dimen name="exo_styled_bottom_bar_margin_top">10dp</dimen>
|
||||
<dimen name="exo_styled_controls_padding">0dp</dimen>
|
||||
<dimen name="exo_styled_minimal_controls_margin_bottom">4dp</dimen>
|
||||
|
||||
<dimen name="exo_error_message_height">32dp</dimen>
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
</style>
|
||||
|
||||
<style name="ExoStyledControls.Button.Center.FfwdWithAmount">
|
||||
<item name="android:background">@drawable/exo_ripple_ffwd</item>
|
||||
<item name="android:foreground">@drawable/exo_styled_controls_fastforward</item>
|
||||
<item name="android:gravity">center|bottom</item>
|
||||
<item name="android:paddingBottom">@dimen/exo_icon_padding_bottom</item>
|
||||
<item name="android:textAppearance">@style/ExoStyledControls.ButtonText</item>
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
</style>
|
||||
|
||||
<style name="ExoStyledControls.Button.Center.RewWithAmount">
|
||||
<item name="android:background">@drawable/exo_ripple_rew</item>
|
||||
<item name="android:foreground">@drawable/exo_styled_controls_rewind</item>
|
||||
<item name="android:gravity">center|bottom</item>
|
||||
<item name="android:paddingBottom">@dimen/exo_icon_padding_bottom</item>
|
||||
<item name="android:textAppearance">@style/ExoStyledControls.ButtonText</item>
|
||||
|
|
|
|||
Loading…
Reference in a new issue