diff --git a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java index f5a669788..f7ad38dd9 100644 --- a/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/BasePlayer.java @@ -1131,6 +1131,7 @@ public abstract class BasePlayer implements Log.d(TAG, "onFastRewind() called"); } seekBy(-getSeekDuration()); + triggerProgressUpdate(); } public void onFastForward() { @@ -1138,6 +1139,7 @@ public abstract class BasePlayer implements Log.d(TAG, "onFastForward() called"); } seekBy(getSeekDuration()); + triggerProgressUpdate(); } private int getSeekDuration() { diff --git a/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java b/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java index 2c9c4a425..72becef8f 100644 --- a/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java +++ b/app/src/main/java/org/schabi/newpipe/player/ServicePlayerActivity.java @@ -45,7 +45,6 @@ import org.schabi.newpipe.util.ThemeHelper; import java.util.Collections; import java.util.List; -import static org.schabi.newpipe.player.helper.PlayerHelper.formatPitch; import static org.schabi.newpipe.player.helper.PlayerHelper.formatSpeed; import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage; @@ -84,14 +83,13 @@ public abstract class ServicePlayerActivity extends AppCompatActivity private ImageButton repeatButton; private ImageButton backwardButton; + private ImageButton fastRewindButton; private ImageButton playPauseButton; + private ImageButton fastForwardButton; private ImageButton forwardButton; private ImageButton shuffleButton; private ProgressBar progressBar; - private TextView playbackSpeedButton; - private TextView playbackPitchButton; - private Menu menu; //////////////////////////////////////////////////////////////////////////// @@ -166,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; @@ -310,20 +311,20 @@ public abstract class ServicePlayerActivity extends AppCompatActivity private void buildControls() { repeatButton = rootView.findViewById(R.id.control_repeat); backwardButton = rootView.findViewById(R.id.control_backward); + fastRewindButton = rootView.findViewById(R.id.control_fast_rewind); playPauseButton = rootView.findViewById(R.id.control_play_pause); + fastForwardButton = rootView.findViewById(R.id.control_fast_forward); forwardButton = rootView.findViewById(R.id.control_forward); shuffleButton = rootView.findViewById(R.id.control_shuffle); - playbackSpeedButton = rootView.findViewById(R.id.control_playback_speed); - playbackPitchButton = rootView.findViewById(R.id.control_playback_pitch); progressBar = rootView.findViewById(R.id.control_progress_bar); repeatButton.setOnClickListener(this); backwardButton.setOnClickListener(this); + fastRewindButton.setOnClickListener(this); playPauseButton.setOnClickListener(this); + fastForwardButton.setOnClickListener(this); forwardButton.setOnClickListener(this); shuffleButton.setOnClickListener(this); - playbackSpeedButton.setOnClickListener(this); - playbackPitchButton.setOnClickListener(this); } private void buildItemPopupMenu(final PlayQueueItem item, final View view) { @@ -473,16 +474,16 @@ public abstract class ServicePlayerActivity extends AppCompatActivity player.onRepeatClicked(); } else if (view.getId() == backwardButton.getId()) { player.onPlayPrevious(); + } else if (view.getId() == fastRewindButton.getId()) { + player.onFastRewind(); } else if (view.getId() == playPauseButton.getId()) { player.onPlayPause(); + } else if (view.getId() == fastForwardButton.getId()) { + player.onFastForward(); } else if (view.getId() == forwardButton.getId()) { player.onPlayNext(); } else if (view.getId() == shuffleButton.getId()) { player.onShuffleClicked(); - } else if (view.getId() == playbackSpeedButton.getId()) { - openPlaybackParameterDialog(); - } else if (view.getId() == playbackPitchButton.getId()) { - openPlaybackParameterDialog(); } else if (view.getId() == metadata.getId()) { scrollToSelected(); } else if (view.getId() == progressLiveSync.getId()) { @@ -690,8 +691,10 @@ public abstract class ServicePlayerActivity extends AppCompatActivity private void onPlaybackParameterChanged(final PlaybackParameters parameters) { if (parameters != null) { - playbackSpeedButton.setText(formatSpeed(parameters.speed)); - playbackPitchButton.setText(formatPitch(parameters.pitch)); + if (menu != null && player != null) { + final MenuItem item = menu.findItem(R.id.action_playback_speed); + item.setTitle(formatSpeed(parameters.speed)); + } } } diff --git a/app/src/main/res/layout-land/activity_player_queue_control.xml b/app/src/main/res/layout-land/activity_player_queue_control.xml index c852da65e..84a29e0c8 100644 --- a/app/src/main/res/layout-land/activity_player_queue_control.xml +++ b/app/src/main/res/layout-land/activity_player_queue_control.xml @@ -111,7 +111,7 @@ tools:ignore="RtlHardcoded"> @@ -161,7 +161,7 @@ android:visibility="invisible"/> @@ -185,8 +185,8 @@ android:orientation="horizontal" tools:ignore="RtlHardcoded"> - + android:background="?attr/selectableItemBackgroundBorderless" + android:clickable="true" + android:focusable="true" + android:scaleType="fitXY" + android:src="@drawable/exo_controls_previous" + android:tint="?attr/colorAccent" + tools:ignore="ContentDescription" /> - + android:background="?attr/selectableItemBackgroundBorderless" + android:clickable="true" + android:focusable="true" + android:scaleType="fitXY" + android:src="@drawable/exo_controls_next" + android:tint="?attr/colorAccent" + tools:ignore="ContentDescription" /> diff --git a/app/src/main/res/layout/activity_player_queue_control.xml b/app/src/main/res/layout/activity_player_queue_control.xml index 71a93506f..628c8f56c 100644 --- a/app/src/main/res/layout/activity_player_queue_control.xml +++ b/app/src/main/res/layout/activity_player_queue_control.xml @@ -169,22 +169,6 @@ android:orientation="horizontal" tools:ignore="RtlHardcoded"> - - + + + + + - \ No newline at end of file diff --git a/app/src/main/res/menu/menu_play_queue.xml b/app/src/main/res/menu/menu_play_queue.xml index cdbc43e80..cab2e8df5 100644 --- a/app/src/main/res/menu/menu_play_queue.xml +++ b/app/src/main/res/menu/menu_play_queue.xml @@ -10,6 +10,14 @@ android:visible="true" app:showAsAction="ifRoom"/> + + +