mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 08:30:44 +00:00
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:
|
||||
appendAllToPlaylist();
|
||||
return true;
|
||||
case R.id.action_playback_speed:
|
||||
openPlaybackParameterDialog();
|
||||
return true;
|
||||
case R.id.action_mute:
|
||||
player.onMuteUnmuteButtonClicked();
|
||||
return true;
|
||||
@ -688,7 +691,10 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
|
||||
|
||||
private void onPlaybackParameterChanged(final PlaybackParameters parameters) {
|
||||
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"
|
||||
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
|
||||
android:id="@+id/action_mute"
|
||||
android:icon="?attr/volume_off"
|
||||
|
Loading…
Reference in New Issue
Block a user