mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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: 342162231
This commit is contained in:
parent
7fd78666d1
commit
8d84a50fa1
8 changed files with 23 additions and 49 deletions
|
|
@ -36,6 +36,7 @@
|
||||||
`LeanbackPlayerAdapter` and use `ControlDispatcher` for dispatching
|
`LeanbackPlayerAdapter` and use `ControlDispatcher` for dispatching
|
||||||
prepare instead
|
prepare instead
|
||||||
([#7882](https://github.com/google/ExoPlayer/issues/7882)).
|
([#7882](https://github.com/google/ExoPlayer/issues/7882)).
|
||||||
|
* Switch StyledPlayerView button controls to borderless ripples.
|
||||||
* Audio:
|
* Audio:
|
||||||
* Retry playback after some types of `AudioTrack` error.
|
* Retry playback after some types of `AudioTrack` error.
|
||||||
* Work around `AudioManager` crashes when calling `getStreamVolume`
|
* Work around `AudioManager` crashes when calling `getStreamVolume`
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,7 @@
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
android:color="@color/exo_gray">
|
<!-- Borderless is not available before v21 -->
|
||||||
<item android:id="@android:id/mask">
|
<item android:drawable="?android:attr/selectableItemBackgroundBorderless" />
|
||||||
<shape android:shape="rectangle">
|
</layer-list>
|
||||||
<solid android:color="@color/exo_white" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
<item android:id="@android:id/background"
|
|
||||||
android:drawable="@drawable/exo_styled_controls_rewind" />
|
|
||||||
</ripple>
|
|
||||||
|
|
@ -14,16 +14,8 @@
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
<item android:state_pressed="true">
|
<item android:drawable="@drawable/exo_selectable_item_background_borderless" />
|
||||||
<layer-list>
|
<item android:id="@android:id/background"
|
||||||
<item>
|
android:drawable="@drawable/exo_styled_controls_fastforward" />
|
||||||
<shape>
|
</layer-list>
|
||||||
<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>
|
|
||||||
|
|
|
||||||
|
|
@ -14,16 +14,8 @@
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
|
||||||
<item android:state_pressed="true">
|
<item android:drawable="@drawable/exo_selectable_item_background_borderless" />
|
||||||
<layer-list>
|
<item android:id="@android:id/background"
|
||||||
<item>
|
android:drawable="@drawable/exo_styled_controls_rewind" />
|
||||||
<shape>
|
</layer-list>
|
||||||
<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>
|
|
||||||
|
|
|
||||||
|
|
@ -14,13 +14,7 @@
|
||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
android:color="@color/exo_gray">
|
<!-- Borderless is not available before v21 -->
|
||||||
<item android:id="@android:id/mask">
|
<item android:drawable="?android:attr/selectableItemBackground" />
|
||||||
<shape android:shape="rectangle">
|
</layer-list>
|
||||||
<solid android:color="@color/exo_white" />
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
<item android:id="@android:id/background"
|
|
||||||
android:drawable="@drawable/exo_styled_controls_fastforward" />
|
|
||||||
</ripple>
|
|
||||||
|
|
@ -16,8 +16,10 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="24dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
android:visibility="visible">
|
android:visibility="visible">
|
||||||
|
|
||||||
<ImageButton android:id="@+id/exo_prev"
|
<ImageButton android:id="@+id/exo_prev"
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,6 @@
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
<color name="exo_gray">#808080</color>
|
|
||||||
<color name="exo_gray_ripple">#80808080</color>
|
|
||||||
<color name="exo_white">#ffffff</color>
|
<color name="exo_white">#ffffff</color>
|
||||||
<color name="exo_white_opacity_70">#B3ffffff</color>
|
<color name="exo_white_opacity_70">#B3ffffff</color>
|
||||||
<color name="exo_black_opacity_70">#B3000000</color>
|
<color name="exo_black_opacity_70">#B3000000</color>
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
<style name="ExoStyledControls"/>
|
<style name="ExoStyledControls"/>
|
||||||
|
|
||||||
<style name="ExoStyledControls.Button">
|
<style name="ExoStyledControls.Button">
|
||||||
<item name="android:background">?android:attr/selectableItemBackground</item>
|
<item name="android:background">@drawable/exo_selectable_item_background_borderless</item>
|
||||||
<item name="android:scaleType">fitXY</item>
|
<item name="android:scaleType">fitXY</item>
|
||||||
<item name="android:layout_marginLeft">@dimen/exo_icon_horizontal_margin</item>
|
<item name="android:layout_marginLeft">@dimen/exo_icon_horizontal_margin</item>
|
||||||
<item name="android:layout_marginRight">@dimen/exo_icon_horizontal_margin</item>
|
<item name="android:layout_marginRight">@dimen/exo_icon_horizontal_margin</item>
|
||||||
|
|
@ -134,6 +134,7 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="ExoStyledControls.Button.Bottom">
|
<style name="ExoStyledControls.Button.Bottom">
|
||||||
|
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||||
<item name="android:gravity">center_horizontal</item>
|
<item name="android:gravity">center_horizontal</item>
|
||||||
<item name="android:layout_width">@dimen/exo_small_icon_width</item>
|
<item name="android:layout_width">@dimen/exo_small_icon_width</item>
|
||||||
<item name="android:layout_height">@dimen/exo_small_icon_height</item>
|
<item name="android:layout_height">@dimen/exo_small_icon_height</item>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue