Commit 133d37bf authored by Adrien Maglo's avatar Adrien Maglo

Styles: add a style for the audio player control icons

parent 34d3ecb8
......@@ -76,7 +76,7 @@
android:contentDescription="@string/pause"
android:focusable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_pause" />
android:src="?attr/ic_pause" />
<View
android:layout_width="10dp"
......@@ -171,7 +171,7 @@
android:contentDescription="@string/previous"
android:focusable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_previous" />
android:src="?attr/ic_previous" />
<ImageButton
android:id="@+id/play_pause"
......@@ -183,7 +183,7 @@
android:contentDescription="@string/pause"
android:focusable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_pause" />
android:src="?attr/ic_pause" />
<ImageButton
android:id="@+id/next"
......@@ -193,7 +193,7 @@
android:contentDescription="@string/next"
android:focusable="true"
android:scaleType="fitXY"
android:src="@drawable/ic_next" />
android:src="?attr/ic_next" />
<ImageButton
android:id="@+id/repeat"
......
......@@ -36,6 +36,10 @@
<attr name="ic_shuffle_normal" format="reference" />
<attr name="ic_shuffle_pressed" format="reference" />
<attr name="ic_audio_player_dots" format="reference" />
<attr name="ic_play" format="reference" />
<attr name="ic_pause" format="reference" />
<attr name="ic_previous" format="reference" />
<attr name="ic_next" format="reference" />
<attr name="mini_player_top_shadow" format="reference" />
<attr name="audio_playlist_shadow" format="reference" />
......
......@@ -54,6 +54,10 @@
<item name="ic_shuffle_normal">@drawable/ic_shuffle_normal</item>
<item name="ic_shuffle_pressed">@drawable/ic_shuffle_pressed</item>
<item name="ic_audio_player_dots">@drawable/dots_dark</item>
<item name="ic_play">@drawable/ic_play</item>
<item name="ic_pause">@drawable/ic_pause</item>
<item name="ic_previous">@drawable/ic_previous</item>
<item name="ic_next">@drawable/ic_next</item>
</style>
<style name="Theme.VLC.Black" parent="Theme.VLC">
......@@ -77,6 +81,10 @@
<item name="ic_repeat_normal">@drawable/ic_repeat_normal_w</item>
<item name="ic_shuffle_normal">@drawable/ic_shuffle_normal_w</item>
<item name="ic_audio_player_dots">@drawable/dots</item>
<item name="ic_play">@drawable/ic_play_w</item>
<item name="ic_pause">@drawable/ic_pause_w</item>
<item name="ic_previous">@drawable/ic_previous_w</item>
<item name="ic_next">@drawable/ic_next_w</item>
</style>
<style name="Theme.VLC.List">
......
......@@ -42,6 +42,7 @@ import org.videolan.vlc.widget.AudioMediaSwitcher.AudioMediaSwitcherListener;
import android.media.AudioManager;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.util.Log;
import android.view.ContextMenu;
import android.view.LayoutInflater;
......@@ -311,15 +312,17 @@ public class AudioPlayer extends Fragment implements IAudioPlayer {
mHeaderMediaSwitcher.updateMedia();
mCoverMediaSwitcher.updateMedia();
FragmentActivity act = getActivity();
if (mAudioController.isPlaying()) {
mPlayPause.setImageResource(R.drawable.ic_pause);
mPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_pause));
mPlayPause.setContentDescription(getString(R.string.pause));
mHeaderPlayPause.setImageResource(R.drawable.ic_pause);
mHeaderPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_pause));
mHeaderPlayPause.setContentDescription(getString(R.string.pause));
} else {
mPlayPause.setImageResource(R.drawable.ic_play);
mPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_play));
mPlayPause.setContentDescription(getString(R.string.play));
mHeaderPlayPause.setImageResource(R.drawable.ic_play);
mHeaderPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_play));
mHeaderPlayPause.setContentDescription(getString(R.string.play));
}
if (mAudioController.isShuffling()) {
......
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 to comment