summaryrefslogtreecommitdiff
path: root/app/src/main/java/de/danoeh/antennapod/dialog
diff options
context:
space:
mode:
authorquails4Eva <dpetchey@gmail.com>2024-03-03 19:17:22 +0000
committerGitHub <noreply@github.com>2024-03-03 20:17:22 +0100
commit60f3d77eb2d41d49ad6fd999c39f5792f804a17e (patch)
tree63482639471c4a6c3592663477519af9fdcd6ec0 /app/src/main/java/de/danoeh/antennapod/dialog
parent3c77d43e76535465ef5c9976835d42439797fd8f (diff)
downloadAntennaPod-60f3d77eb2d41d49ad6fd999c39f5792f804a17e.zip
Skip silence setting per feed (#6910)
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/dialog')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/VariableSpeedDialog.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/VariableSpeedDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/VariableSpeedDialog.java
index 8de7dce04..c62f5df7e 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/VariableSpeedDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/VariableSpeedDialog.java
@@ -37,6 +37,7 @@ public class VariableSpeedDialog extends BottomSheetDialogFragment {
private final List<Float> selectedSpeeds;
private PlaybackSpeedSeekBar speedSeekBar;
private Chip addCurrentSpeedChip;
+ private CheckBox skipSilenceCheckbox;
public VariableSpeedDialog() {
DecimalFormatSymbols format = new DecimalFormatSymbols(Locale.US);
@@ -51,11 +52,13 @@ public class VariableSpeedDialog extends BottomSheetDialogFragment {
@Override
public void loadMediaInfo() {
updateSpeed(new SpeedChangedEvent(controller.getCurrentPlaybackSpeedMultiplier()));
+ updateSkipSilence(controller.getCurrentPlaybackSkipSilence());
}
};
controller.init();
EventBus.getDefault().register(this);
updateSpeed(new SpeedChangedEvent(controller.getCurrentPlaybackSpeedMultiplier()));
+ updateSkipSilence(controller.getCurrentPlaybackSkipSilence());
}
@Override
@@ -72,6 +75,10 @@ public class VariableSpeedDialog extends BottomSheetDialogFragment {
addCurrentSpeedChip.setText(String.format(Locale.getDefault(), "%1$.2f", event.getNewSpeed()));
}
+ public void updateSkipSilence(boolean skipSilence) {
+ skipSilenceCheckbox.setChecked(skipSilence);
+ }
+
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container,
@@ -97,9 +104,9 @@ public class VariableSpeedDialog extends BottomSheetDialogFragment {
addCurrentSpeedChip.setCloseIconContentDescription(getString(R.string.add_preset));
addCurrentSpeedChip.setOnClickListener(v -> addCurrentSpeed());
- final CheckBox skipSilence = root.findViewById(R.id.skipSilence);
- skipSilence.setChecked(UserPreferences.isSkipSilence());
- skipSilence.setOnCheckedChangeListener((buttonView, isChecked) -> {
+ skipSilenceCheckbox = root.findViewById(R.id.skipSilence);
+ skipSilenceCheckbox.setChecked(UserPreferences.isSkipSilence());
+ skipSilenceCheckbox.setOnCheckedChangeListener((buttonView, isChecked) -> {
UserPreferences.setSkipSilence(isChecked);
controller.setSkipSilence(isChecked);
});