Commit b54f0d40 authored by Mik Amchislavsky's avatar Mik Amchislavsky Committed by Geoffrey Métais

AudioPlayer Header: focus related improvement for R.id.header_play_pause

Signed-off-by: default avatarGeoffrey Métais <geoffrey.metais@gmail.com>
parent 76b0aba8
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_pause_pressed_w" android:state_focused="true" android:state_pressed="false"/>
<item android:drawable="@drawable/ic_pause_pressed" android:state_focused="true" android:state_pressed="true"/>
<item android:drawable="@drawable/ic_pause_pressed" android:state_focused="false" android:state_pressed="true"/>
<item android:drawable="@drawable/ic_pause_normal"/>
</selector>
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_pause_pressed" android:state_focused="true" android:state_pressed="false"/>
<item android:drawable="@drawable/ic_pause_pressed_w" android:state_focused="true" android:state_pressed="true"/>
<item android:drawable="@drawable/ic_pause_pressed_w" android:state_focused="false" android:state_pressed="true"/>
<item android:drawable="@drawable/ic_pause_normal_w"/>
</selector>
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_play_pressed_w" android:state_focused="true" android:state_pressed="false"/>
<item android:drawable="@drawable/ic_play_pressed" android:state_focused="true" android:state_pressed="true"/>
<item android:drawable="@drawable/ic_play_pressed" android:state_focused="false" android:state_pressed="true"/>
<item android:drawable="@drawable/ic_play_normal"/>
</selector>
<?xml version="1.0" encoding="UTF-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_play_pressed" android:state_focused="true" android:state_pressed="false"/>
<item android:drawable="@drawable/ic_play_pressed_w" android:state_focused="true" android:state_pressed="true"/>
<item android:drawable="@drawable/ic_play_pressed_w" android:state_focused="false" android:state_pressed="true"/>
<item android:drawable="@drawable/ic_play_normal_w"/>
</selector>
......@@ -76,7 +76,12 @@
android:contentDescription="@string/pause"
android:focusable="true"
android:scaleType="fitXY"
android:src="?attr/ic_pause" />
android:src="?attr/ic_pause_for_header_play_pause"
android:nextFocusForward="@+id/header_play_pause"
android:nextFocusUp="@+id/ml_menu_search"
android:nextFocusDown="@id/header_play_pause"
android:nextFocusLeft="@id/header_play_pause"
android:nextFocusRight="@id/header_play_pause" />
<View
android:layout_width="10dp"
......@@ -213,4 +218,4 @@
android:src="?attr/ic_previous" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
</LinearLayout>
......@@ -39,6 +39,8 @@
<attr name="ic_audio_player_dots" format="reference" />
<attr name="ic_play" format="reference" />
<attr name="ic_pause" format="reference" />
<attr name="ic_play_for_header_play_pause" format="reference" />
<attr name="ic_pause_for_header_play_pause" format="reference" />
<attr name="ic_previous" format="reference" />
<attr name="ic_next" format="reference" />
<attr name="ic_menu_video" format="reference" />
......@@ -60,4 +62,4 @@
<attr name="marginTopContent" format="dimension" />
</resources>
\ No newline at end of file
</resources>
......@@ -58,6 +58,8 @@
<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_play_for_header_play_pause">@drawable/ic_play_for_header_play_pause</item>
<item name="ic_pause_for_header_play_pause">@drawable/ic_pause_for_header_play_pause</item>
<item name="ic_previous">@drawable/ic_previous</item>
<item name="ic_next">@drawable/ic_next</item>
<item name="ic_menu_video">@drawable/ic_menu_video</item>
......@@ -119,6 +121,8 @@
<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_play_for_header_play_pause">@drawable/ic_play_for_header_play_pause_w</item>
<item name="ic_pause_for_header_play_pause">@drawable/ic_pause_for_header_play_pause_w</item>
<item name="ic_previous">@drawable/ic_previous_w</item>
<item name="ic_next">@drawable/ic_next_w</item>
<item name="ic_menu_video">@drawable/ic_menu_video_w</item>
......
......@@ -327,12 +327,12 @@ public class AudioPlayer extends Fragment implements IAudioPlayer {
if (mAudioController.isPlaying()) {
mPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_pause));
mPlayPause.setContentDescription(getString(R.string.pause));
mHeaderPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_pause));
mHeaderPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_pause_for_header_play_pause));
mHeaderPlayPause.setContentDescription(getString(R.string.pause));
} else {
mPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_play));
mPlayPause.setContentDescription(getString(R.string.play));
mHeaderPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_play));
mHeaderPlayPause.setImageResource(Util.getResourceFromAttribute(act, R.attr.ic_play_for_header_play_pause));
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