Commit b16cf594 by olly Committed by Ian Baker

Rollback of https://github.com/google/ExoPlayer/commit/8d84a50fa1c86f730105cd648bb2454f365830d4

*** Original commit ***

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: 343531411
parent a987e106
......@@ -48,7 +48,6 @@
`LeanbackPlayerAdapter` and use `ControlDispatcher` for dispatching
prepare instead
([#7882](https://github.com/google/ExoPlayer/issues/7882)).
* Switch `StyledPlayerControlView` button controls to borderless ripples.
* Add `bar_gravity` attribute into `DefaultTimeBar`.
* Increase seekbar's touch target height in `StyledPlayerControlView`.
* Update Styled Player settings dialogs to respect RTL.
......
......@@ -14,7 +14,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Borderless is not available before v21 -->
<item android:drawable="?android:attr/selectableItemBackgroundBorderless" />
</layer-list>
<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>
......@@ -14,7 +14,13 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Borderless is not available before v21 -->
<item android:drawable="?android:attr/selectableItemBackground" />
</layer-list>
<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>
......@@ -14,8 +14,16 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/exo_selectable_item_background_borderless" />
<item android:id="@android:id/background"
android:drawable="@drawable/exo_styled_controls_fastforward" />
</layer-list>
<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>
......@@ -14,8 +14,16 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:drawable="@drawable/exo_selectable_item_background_borderless" />
<item android:id="@android:id/background"
android:drawable="@drawable/exo_styled_controls_rewind" />
</layer-list>
<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>
......@@ -16,10 +16,8 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="24dp"
android:gravity="center"
android:orientation="horizontal"
android:background="@android:color/transparent"
android:visibility="visible">
<ImageButton android:id="@+id/exo_prev"
......
......@@ -15,6 +15,8 @@
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>
......
......@@ -59,7 +59,7 @@
<style name="ExoStyledControls"/>
<style name="ExoStyledControls.Button">
<item name="android:background">@drawable/exo_selectable_item_background_borderless</item>
<item name="android:background">?android:attr/selectableItemBackground</item>
<item name="android:scaleType">fitXY</item>
<item name="android:layout_marginLeft">@dimen/exo_icon_horizontal_margin</item>
<item name="android:layout_marginRight">@dimen/exo_icon_horizontal_margin</item>
......@@ -141,7 +141,6 @@
</style>
<style name="ExoStyledControls.Button.Bottom">
<item name="android:background">?android:attr/selectableItemBackground</item>
<item name="android:gravity">center_horizontal</item>
<item name="android:layout_width">@dimen/exo_small_icon_width</item>
<item name="android:layout_height">@dimen/exo_small_icon_height</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment