Add speed button to top bar
This commit is contained in:
parent
36b4134838
commit
72af51fe9d
|
@ -164,6 +164,9 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
|
||||||
case R.id.action_append_playlist:
|
case R.id.action_append_playlist:
|
||||||
appendAllToPlaylist();
|
appendAllToPlaylist();
|
||||||
return true;
|
return true;
|
||||||
|
case R.id.action_playback_speed:
|
||||||
|
openPlaybackParameterDialog();
|
||||||
|
return true;
|
||||||
case R.id.action_mute:
|
case R.id.action_mute:
|
||||||
player.onMuteUnmuteButtonClicked();
|
player.onMuteUnmuteButtonClicked();
|
||||||
return true;
|
return true;
|
||||||
|
@ -688,7 +691,10 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
|
||||||
|
|
||||||
private void onPlaybackParameterChanged(final PlaybackParameters parameters) {
|
private void onPlaybackParameterChanged(final PlaybackParameters parameters) {
|
||||||
if (parameters != null) {
|
if (parameters != null) {
|
||||||
Log.d("Dupa", "12");
|
if (menu != null && player != null) {
|
||||||
|
MenuItem item = menu.findItem(R.id.action_playback_speed);
|
||||||
|
item.setTitle(formatSpeed(parameters.speed));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,14 @@
|
||||||
android:visible="true"
|
android:visible="true"
|
||||||
app:showAsAction="ifRoom"/>
|
app:showAsAction="ifRoom"/>
|
||||||
|
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_playback_speed"
|
||||||
|
android:title="1x"
|
||||||
|
android:tooltipText="@string/playback_speed_control"
|
||||||
|
android:visible="true"
|
||||||
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_mute"
|
android:id="@+id/action_mute"
|
||||||
android:icon="?attr/volume_off"
|
android:icon="?attr/volume_off"
|
||||||
|
|
Loading…
Reference in New Issue