summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/PlaybackControlsDialog.java49
-rw-r--r--app/src/main/res/layout/audio_controls.xml69
2 files changed, 10 insertions, 108 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/PlaybackControlsDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/PlaybackControlsDialog.java
index 195891499..3186cbe2e 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/PlaybackControlsDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/PlaybackControlsDialog.java
@@ -10,11 +10,9 @@ import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.DialogFragment;
import android.widget.Button;
import android.widget.CheckBox;
-import android.widget.SeekBar;
import android.widget.TextView;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.preferences.UserPreferences;
-import de.danoeh.antennapod.core.util.Converter;
import de.danoeh.antennapod.core.util.playback.PlaybackController;
import de.danoeh.antennapod.view.PlaybackSpeedSeekBar;
@@ -63,11 +61,7 @@ public class PlaybackControlsDialog extends DialogFragment {
dialog = new AlertDialog.Builder(getContext())
.setTitle(R.string.audio_controls)
.setView(R.layout.audio_controls)
- .setPositiveButton(R.string.close_label, (dialog1, which) -> {
- final SeekBar left = dialog.findViewById(R.id.volume_left);
- final SeekBar right = dialog.findViewById(R.id.volume_right);
- UserPreferences.setVolume(left.getProgress(), right.getProgress());
- }).create();
+ .setPositiveButton(R.string.close_label, null).create();
return dialog;
}
@@ -79,10 +73,6 @@ public class PlaybackControlsDialog extends DialogFragment {
speedSeekBar.setProgressChangedListener(speed
-> txtvPlaybackSpeed.setText(String.format(Locale.getDefault(), "%.2fx", speed)));
- final SeekBar barLeftVolume = dialog.findViewById(R.id.volume_left);
- barLeftVolume.setProgress(UserPreferences.getLeftVolumePercentage());
- final SeekBar barRightVolume = dialog.findViewById(R.id.volume_right);
- barRightVolume.setProgress(UserPreferences.getRightVolumePercentage());
final CheckBox stereoToMono = dialog.findViewById(R.id.stereo_to_mono);
stereoToMono.setChecked(UserPreferences.stereoToMono());
if (controller != null && !controller.canDownmix()) {
@@ -91,10 +81,6 @@ public class PlaybackControlsDialog extends DialogFragment {
stereoToMono.setText(getString(R.string.stereo_to_mono) + " [" + sonicOnly + "]");
}
- if (UserPreferences.useExoplayer()) {
- barRightVolume.setEnabled(false);
- }
-
final CheckBox skipSilence = dialog.findViewById(R.id.skipSilence);
skipSilence.setChecked(UserPreferences.isSkipSilence());
if (!UserPreferences.useExoplayer()) {
@@ -106,39 +92,6 @@ public class PlaybackControlsDialog extends DialogFragment {
UserPreferences.setSkipSilence(isChecked);
controller.setSkipSilence(isChecked);
});
-
- barLeftVolume.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
- @Override
- public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- controller.setVolume(
- Converter.getVolumeFromPercentage(progress),
- Converter.getVolumeFromPercentage(barRightVolume.getProgress()));
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) {
- }
-
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) {
- }
- });
- barRightVolume.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
- @Override
- public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- controller.setVolume(
- Converter.getVolumeFromPercentage(barLeftVolume.getProgress()),
- Converter.getVolumeFromPercentage(progress));
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) {
- }
-
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) {
- }
- });
stereoToMono.setOnCheckedChangeListener((buttonView, isChecked) -> {
UserPreferences.stereoToMono(isChecked);
if (controller != null) {
diff --git a/app/src/main/res/layout/audio_controls.xml b/app/src/main/res/layout/audio_controls.xml
index 2c9665aad..0bfa4f521 100644
--- a/app/src/main/res/layout/audio_controls.xml
+++ b/app/src/main/res/layout/audio_controls.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:orientation="vertical"
android:padding="16dp">
<LinearLayout
@@ -17,7 +17,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
- android:layout_marginBottom="8dp"/>
+ android:layout_marginBottom="8dp" />
<LinearLayout
android:layout_width="match_parent"
@@ -27,9 +27,9 @@
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
- style="@style/AntennaPod.TextView.ListItemPrimaryTitle"
android:layout_weight="1"
- android:text="@string/playback_speed" />
+ android:text="@string/playback_speed"
+ style="@style/AntennaPod.TextView.ListItemPrimaryTitle" />
<TextView
android:id="@+id/txtvPlaybackSpeed"
@@ -42,67 +42,14 @@
<de.danoeh.antennapod.view.PlaybackSpeedSeekBar
android:id="@+id/speed_seek_bar"
android:layout_width="match_parent"
- android:layout_height="wrap_content"/>
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="12dp"
- android:layout_marginBottom="4dp"
- style="@style/AntennaPod.TextView.ListItemPrimaryTitle"
- android:text="@string/volume" />
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginLeft="8dp"
- android:layout_marginStart="8dp"
- android:orientation="horizontal"
- android:gravity="center">
-
- <TextView
- android:id="@+id/txtvLeft"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/left_short" />
-
- <SeekBar
- android:id="@+id/volume_left"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:max="100" />
-
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="8dp"
- android:layout_marginLeft="8dp"
- android:layout_marginStart="8dp"
- android:orientation="horizontal"
- android:gravity="center">
-
- <TextView
- android:id="@+id/txtvRight"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/right_short" />
-
- <SeekBar
- android:id="@+id/volume_right"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:max="100" />
-
- </LinearLayout>
+ android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
- style="@style/AntennaPod.TextView.ListItemPrimaryTitle"
- android:text="@string/audio_effects" />
+ android:text="@string/audio_effects"
+ style="@style/AntennaPod.TextView.ListItemPrimaryTitle" />
<CheckBox
android:id="@+id/skipSilence"
@@ -115,5 +62,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/stereo_to_mono" />
+
</LinearLayout>
+
</ScrollView>