Skip to content

Commit a6cc138

Browse files
Use Map.of().
1 parent 55a995c commit a6cc138

1 file changed

Lines changed: 7 additions & 12 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/helper/PlaybackParameterDialog.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.schabi.newpipe.util.SimpleOnSeekBarChangeListener;
3131
import org.schabi.newpipe.util.SliderStrategy;
3232

33-
import java.util.HashMap;
3433
import java.util.Map;
3534
import java.util.Objects;
3635
import java.util.function.Consumer;
@@ -334,10 +333,8 @@ private void setupPitchControlModeTextView(
334333
}
335334

336335
private Map<Boolean, TextView> getPitchControlModeComponentMappings() {
337-
final Map<Boolean, TextView> mappings = new HashMap<>();
338-
mappings.put(PITCH_CTRL_MODE_PERCENT, binding.pitchControlModePercent);
339-
mappings.put(PITCH_CTRL_MODE_SEMITONE, binding.pitchControlModeSemitone);
340-
return mappings;
336+
return Map.of(PITCH_CTRL_MODE_PERCENT, binding.pitchControlModePercent,
337+
PITCH_CTRL_MODE_SEMITONE, binding.pitchControlModeSemitone);
341338
}
342339

343340
private void changePitchControlMode(final boolean semitones) {
@@ -407,13 +404,11 @@ private void setupStepTextView(
407404
}
408405

409406
private Map<Double, TextView> getStepSizeComponentMappings() {
410-
final Map<Double, TextView> mappings = new HashMap<>();
411-
mappings.put(STEP_1_PERCENT_VALUE, binding.stepSizeOnePercent);
412-
mappings.put(STEP_5_PERCENT_VALUE, binding.stepSizeFivePercent);
413-
mappings.put(STEP_10_PERCENT_VALUE, binding.stepSizeTenPercent);
414-
mappings.put(STEP_25_PERCENT_VALUE, binding.stepSizeTwentyFivePercent);
415-
mappings.put(STEP_100_PERCENT_VALUE, binding.stepSizeOneHundredPercent);
416-
return mappings;
407+
return Map.of(STEP_1_PERCENT_VALUE, binding.stepSizeOnePercent,
408+
STEP_5_PERCENT_VALUE, binding.stepSizeFivePercent,
409+
STEP_10_PERCENT_VALUE, binding.stepSizeTenPercent,
410+
STEP_25_PERCENT_VALUE, binding.stepSizeTwentyFivePercent,
411+
STEP_100_PERCENT_VALUE, binding.stepSizeOneHundredPercent);
417412
}
418413

419414
private void setStepSizeToUI(final double newStepSize) {

0 commit comments

Comments
 (0)