1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-24 00:50:32 +00:00

-Removed duplicate dialog open instances in service player activity.

This commit is contained in:
John Zhen Mo 2018-03-22 18:44:03 -07:00
parent 72eaff148c
commit 02f48ccc7f

View File

@ -433,12 +433,10 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
player.onShuffleClicked(); player.onShuffleClicked();
} else if (view.getId() == playbackSpeedButton.getId()) { } else if (view.getId() == playbackSpeedButton.getId()) {
PlaybackParameterDialog.newInstance(player.getPlaybackSpeed(), openPlaybackParameterDialog();
player.getPlaybackPitch()).show(getSupportFragmentManager(), getTag());
} else if (view.getId() == playbackPitchButton.getId()) { } else if (view.getId() == playbackPitchButton.getId()) {
PlaybackParameterDialog.newInstance(player.getPlaybackSpeed(), openPlaybackParameterDialog();
player.getPlaybackPitch()).show(getSupportFragmentManager(), getTag());
} else if (view.getId() == metadata.getId()) { } else if (view.getId() == metadata.getId()) {
scrollToSelected(); scrollToSelected();
@ -450,9 +448,15 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
} }
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// Playback Parameters Listener // Playback Parameters
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
private void openPlaybackParameterDialog() {
if (player == null) return;
PlaybackParameterDialog.newInstance(player.getPlaybackSpeed(),
player.getPlaybackPitch()).show(getSupportFragmentManager(), getTag());
}
@Override @Override
public void onPlaybackParameterChanged(float playbackTempo, float playbackPitch) { public void onPlaybackParameterChanged(float playbackTempo, float playbackPitch) {
if (player != null) player.setPlaybackParameters(playbackTempo, playbackPitch); if (player != null) player.setPlaybackParameters(playbackTempo, playbackPitch);