Add speed dialog to video player

It got lost when removing the speed bar from the audio controls dialog
This commit is contained in:
ByteHamster 2022-05-15 08:59:22 +02:00
parent 8cac0c71e4
commit d9dbfa1711
2 changed files with 11 additions and 0 deletions

View File

@ -36,6 +36,7 @@ import androidx.core.view.WindowCompat;
import androidx.interpolator.view.animation.FastOutSlowInInterpolator; import androidx.interpolator.view.animation.FastOutSlowInInterpolator;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import de.danoeh.antennapod.R; import de.danoeh.antennapod.R;
import de.danoeh.antennapod.dialog.VariableSpeedDialog;
import de.danoeh.antennapod.event.playback.BufferUpdateEvent; import de.danoeh.antennapod.event.playback.BufferUpdateEvent;
import de.danoeh.antennapod.event.playback.PlaybackPositionEvent; import de.danoeh.antennapod.event.playback.PlaybackPositionEvent;
import de.danoeh.antennapod.event.PlayerErrorEvent; import de.danoeh.antennapod.event.PlayerErrorEvent;
@ -591,6 +592,7 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
menu.findItem(R.id.player_switch_to_audio_only).setVisible(true); menu.findItem(R.id.player_switch_to_audio_only).setVisible(true);
menu.findItem(R.id.audio_controls).setIcon(R.drawable.ic_sliders); menu.findItem(R.id.audio_controls).setIcon(R.drawable.ic_sliders);
menu.findItem(R.id.playback_speed).setVisible(true);
return true; return true;
} }
@ -640,6 +642,8 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
} else if (item.getItemId() == R.id.share_item && feedItem != null) { } else if (item.getItemId() == R.id.share_item && feedItem != null) {
ShareDialog shareDialog = ShareDialog.newInstance(feedItem); ShareDialog shareDialog = ShareDialog.newInstance(feedItem);
shareDialog.show(getSupportFragmentManager(), "ShareEpisodeDialog"); shareDialog.show(getSupportFragmentManager(), "ShareEpisodeDialog");
} else if (item.getItemId() == R.id.playback_speed) {
new VariableSpeedDialog().show(getSupportFragmentManager(), null);
} else { } else {
return false; return false;
} }

View File

@ -35,6 +35,13 @@
custom:showAsAction="always"> custom:showAsAction="always">
</item> </item>
<item
android:id="@+id/playback_speed"
android:title="@string/playback_speed"
android:visible="false"
custom:showAsAction="never">
</item>
<item <item
android:id="@+id/open_feed_item" android:id="@+id/open_feed_item"
android:icon="@drawable/ic_feed" android:icon="@drawable/ic_feed"