From c2bf7f09ceb635cae8f42b82d8af0424a4fcce1a Mon Sep 17 00:00:00 2001 From: litetex <40789489+litetex@users.noreply.github.com> Date: Tue, 3 May 2022 21:42:09 +0200 Subject: [PATCH] Fixed accidental reset of ``PlaybackParameterDialog`` on initialization --- .../newpipe/player/helper/PlaybackParameterDialog.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java b/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java index 7220335d1..19a5a645b 100644 --- a/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java +++ b/app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java @@ -213,7 +213,7 @@ public class PlaybackParameterDialog extends DialogFragment { getPitchControlModeComponentMappings() .forEach(this::setupPitchControlModeTextView); - changePitchControlMode(isCurrentPitchControlModeSemitone()); + // Initialization is done at the end // Pitch - Percent setText(binding.pitchPercentMinimumText, PlayerHelper::formatPitch, MIN_PITCH_OR_SPEED); @@ -275,6 +275,9 @@ public class PlaybackParameterDialog extends DialogFragment { skipSilence = isChecked; updateCallback(); }); + + // PitchControlMode has to be initialized at the end because it requires the unhookCheckbox + changePitchControlMode(isCurrentPitchControlModeSemitone()); } // -- General formatting --