Commit c879bbf6 by bachinger Committed by Oliver Woodman

move transparency of shuffle mode off button to bitmap

PiperOrigin-RevId: 266795413
parent 525d0320
...@@ -238,7 +238,7 @@ public class PlayerControlView extends FrameLayout { ...@@ -238,7 +238,7 @@ public class PlayerControlView extends FrameLayout {
private final View fastForwardButton; private final View fastForwardButton;
private final View rewindButton; private final View rewindButton;
private final ImageView repeatToggleButton; private final ImageView repeatToggleButton;
private final View shuffleButton; private final ImageView shuffleButton;
private final View vrButton; private final View vrButton;
private final TextView durationView; private final TextView durationView;
private final TextView positionView; private final TextView positionView;
...@@ -256,6 +256,8 @@ public class PlayerControlView extends FrameLayout { ...@@ -256,6 +256,8 @@ public class PlayerControlView extends FrameLayout {
private final String repeatOffButtonContentDescription; private final String repeatOffButtonContentDescription;
private final String repeatOneButtonContentDescription; private final String repeatOneButtonContentDescription;
private final String repeatAllButtonContentDescription; private final String repeatAllButtonContentDescription;
private final Drawable shuffleOnButtonDrawable;
private final Drawable shuffleOffButtonDrawable;
@Nullable private Player player; @Nullable private Player player;
private com.google.android.exoplayer2.ControlDispatcher controlDispatcher; private com.google.android.exoplayer2.ControlDispatcher controlDispatcher;
...@@ -407,6 +409,8 @@ public class PlayerControlView extends FrameLayout { ...@@ -407,6 +409,8 @@ public class PlayerControlView extends FrameLayout {
repeatOffButtonDrawable = resources.getDrawable(R.drawable.exo_controls_repeat_off); repeatOffButtonDrawable = resources.getDrawable(R.drawable.exo_controls_repeat_off);
repeatOneButtonDrawable = resources.getDrawable(R.drawable.exo_controls_repeat_one); repeatOneButtonDrawable = resources.getDrawable(R.drawable.exo_controls_repeat_one);
repeatAllButtonDrawable = resources.getDrawable(R.drawable.exo_controls_repeat_all); repeatAllButtonDrawable = resources.getDrawable(R.drawable.exo_controls_repeat_all);
shuffleOnButtonDrawable = resources.getDrawable(R.drawable.exo_controls_shuffle_on);
shuffleOffButtonDrawable = resources.getDrawable(R.drawable.exo_controls_shuffle_off);
repeatOffButtonContentDescription = repeatOffButtonContentDescription =
resources.getString(R.string.exo_controls_repeat_off_description); resources.getString(R.string.exo_controls_repeat_off_description);
repeatOneButtonContentDescription = repeatOneButtonContentDescription =
...@@ -815,10 +819,11 @@ public class PlayerControlView extends FrameLayout { ...@@ -815,10 +819,11 @@ public class PlayerControlView extends FrameLayout {
shuffleButton.setVisibility(GONE); shuffleButton.setVisibility(GONE);
} else if (player == null) { } else if (player == null) {
setButtonEnabled(false, shuffleButton); setButtonEnabled(false, shuffleButton);
shuffleButton.setImageDrawable(shuffleOffButtonDrawable);
} else { } else {
shuffleButton.setAlpha(player.getShuffleModeEnabled() ? 1f : 0.3f); setButtonEnabled(true, shuffleButton);
shuffleButton.setEnabled(true); shuffleButton.setImageDrawable(
shuffleButton.setVisibility(VISIBLE); player.getShuffleModeEnabled() ? shuffleOnButtonDrawable : shuffleOffButtonDrawable);
} }
} }
......
<!-- Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32dp"
android:height="32dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#4EFFFFFF"
android:pathData="M10.59 9.17L5.41 4 4 5.41l5.17 5.17 1.42-1.41zM14.5 4l2.04 2.04L4 18.59 5.41 20
17.96 7.46 20 9.5V4h-5.5zm0.33 9.41l-1.41 1.41 3.13 3.13L14.5 20H20v-5.5l-2.04
2.04-3.13-3.13z" />
</vector>
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
</style> </style>
<style name="ExoMediaButton.Shuffle"> <style name="ExoMediaButton.Shuffle">
<item name="android:src">@drawable/exo_controls_shuffle</item> <item name="android:src">@drawable/exo_controls_shuffle_off</item>
<item name="android:contentDescription">@string/exo_controls_shuffle_description</item> <item name="android:contentDescription">@string/exo_controls_shuffle_description</item>
</style> </style>
......
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