Remove speed buttons from bottom menu

This commit is contained in:
TheLastGimbus 2020-06-14 15:15:38 +02:00
parent 1975973ff2
commit 36b4134838
2 changed files with 1 additions and 45 deletions

View file

@ -45,7 +45,6 @@ import org.schabi.newpipe.util.ThemeHelper;
import java.util.Collections; import java.util.Collections;
import java.util.List; 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.player.helper.PlayerHelper.formatSpeed;
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage; import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
@ -91,9 +90,6 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
private ImageButton shuffleButton; private ImageButton shuffleButton;
private ProgressBar progressBar; private ProgressBar progressBar;
private TextView playbackSpeedButton;
private TextView playbackPitchButton;
private Menu menu; private Menu menu;
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
@ -317,8 +313,6 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
fastForwardButton = rootView.findViewById(R.id.control_fast_forward); fastForwardButton = rootView.findViewById(R.id.control_fast_forward);
forwardButton = rootView.findViewById(R.id.control_forward); forwardButton = rootView.findViewById(R.id.control_forward);
shuffleButton = rootView.findViewById(R.id.control_shuffle); 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); progressBar = rootView.findViewById(R.id.control_progress_bar);
repeatButton.setOnClickListener(this); repeatButton.setOnClickListener(this);
@ -328,8 +322,6 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
fastForwardButton.setOnClickListener(this); fastForwardButton.setOnClickListener(this);
forwardButton.setOnClickListener(this); forwardButton.setOnClickListener(this);
shuffleButton.setOnClickListener(this); shuffleButton.setOnClickListener(this);
playbackSpeedButton.setOnClickListener(this);
playbackPitchButton.setOnClickListener(this);
} }
private void buildItemPopupMenu(final PlayQueueItem item, final View view) { private void buildItemPopupMenu(final PlayQueueItem item, final View view) {
@ -489,10 +481,6 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
player.onPlayNext(); player.onPlayNext();
} else if (view.getId() == shuffleButton.getId()) { } else if (view.getId() == shuffleButton.getId()) {
player.onShuffleClicked(); player.onShuffleClicked();
} else if (view.getId() == playbackSpeedButton.getId()) {
openPlaybackParameterDialog();
} else if (view.getId() == playbackPitchButton.getId()) {
openPlaybackParameterDialog();
} else if (view.getId() == metadata.getId()) { } else if (view.getId() == metadata.getId()) {
scrollToSelected(); scrollToSelected();
} else if (view.getId() == progressLiveSync.getId()) { } else if (view.getId() == progressLiveSync.getId()) {
@ -700,8 +688,7 @@ public abstract class ServicePlayerActivity extends AppCompatActivity
private void onPlaybackParameterChanged(final PlaybackParameters parameters) { private void onPlaybackParameterChanged(final PlaybackParameters parameters) {
if (parameters != null) { if (parameters != null) {
playbackSpeedButton.setText(formatSpeed(parameters.speed)); Log.d("Dupa", "12");
playbackPitchButton.setText(formatPitch(parameters.pitch));
} }
} }

View file

@ -169,22 +169,6 @@
android:orientation="horizontal" android:orientation="horizontal"
tools:ignore="RtlHardcoded"> tools:ignore="RtlHardcoded">
<TextView
android:id="@+id/control_playback_speed"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/control_repeat"
android:gravity="center"
android:minWidth="50dp"
android:text="1x"
android:textColor="?attr/colorAccent"
android:textStyle="bold"
android:background="?attr/selectableItemBackground"
tools:ignore="HardcodedText,RtlHardcoded"/>
<ImageButton <ImageButton
android:id="@+id/control_repeat" android:id="@+id/control_repeat"
android:layout_width="30dp" android:layout_width="30dp"
@ -311,21 +295,6 @@
android:src="@drawable/ic_shuffle_white_24dp" android:src="@drawable/ic_shuffle_white_24dp"
tools:ignore="ContentDescription"/> tools:ignore="ContentDescription"/>
<TextView
android:id="@+id/control_playback_pitch"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/control_shuffle"
android:gravity="center"
android:minWidth="50dp"
android:text="100%"
android:textColor="?attr/colorAccent"
android:textStyle="bold"
android:background="?attr/selectableItemBackground"
tools:ignore="HardcodedText,RtlHardcoded"/>
</RelativeLayout> </RelativeLayout>
</RelativeLayout> </RelativeLayout>