diff options
author | Matej Drobnič <services+github@matejdro.com> | 2023-09-08 14:28:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-08 13:28:20 +0100 |
commit | 8ebf1539705aa2251f0e7f795e72bb214e51750b (patch) | |
tree | 3675e58a12cc70a2a9aa9c6d0e79befa08abd7b0 /app/src/main | |
parent | 9ed5485ae353c0cb3c8b2f6a97f2e905d77afd71 (diff) | |
download | AntennaPod-8ebf1539705aa2251f0e7f795e72bb214e51750b.zip |
Add volume boost (#6573)
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java | 40 | ||||
-rw-r--r-- | app/src/main/res/xml/feed_settings.xml | 8 |
2 files changed, 33 insertions, 15 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java index ae9e003d5..0e4c883cf 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/FeedSettingsFragment.java @@ -156,7 +156,7 @@ public class FeedSettingsFragment extends Fragment { setupAutoDownloadPreference(); setupKeepUpdatedPreference(); setupAutoDeletePreference(); - setupVolumeReductionPreferences(); + setupVolumeAdaptationPreferences(); setupNewEpisodesAction(); setupAuthentificationPreference(); setupEpisodeFilterPreference(); @@ -166,7 +166,7 @@ public class FeedSettingsFragment extends Fragment { setupTags(); updateAutoDeleteSummary(); - updateVolumeReductionValue(); + updateVolumeAdaptationValue(); updateAutoDownloadEnabled(); updateNewEpisodesAction(); @@ -317,9 +317,9 @@ public class FeedSettingsFragment extends Fragment { } } - private void setupVolumeReductionPreferences() { - ListPreference volumeReductionPreference = findPreference("volumeReduction"); - volumeReductionPreference.setOnPreferenceChangeListener((preference, newValue) -> { + private void setupVolumeAdaptationPreferences() { + ListPreference volumeAdaptationPreference = findPreference("volumeReduction"); + volumeAdaptationPreference.setOnPreferenceChangeListener((preference, newValue) -> { switch ((String) newValue) { case "off": feedPreferences.setVolumeAdaptionSetting(VolumeAdaptionSetting.OFF); @@ -330,28 +330,46 @@ public class FeedSettingsFragment extends Fragment { case "heavy": feedPreferences.setVolumeAdaptionSetting(VolumeAdaptionSetting.HEAVY_REDUCTION); break; + case "light_boost": + feedPreferences.setVolumeAdaptionSetting(VolumeAdaptionSetting.LIGHT_BOOST); + break; + case "medium_boost": + feedPreferences.setVolumeAdaptionSetting(VolumeAdaptionSetting.MEDIUM_BOOST); + break; + case "heavy_boost": + feedPreferences.setVolumeAdaptionSetting(VolumeAdaptionSetting.HEAVY_BOOST); + break; default: } DBWriter.setFeedPreferences(feedPreferences); - updateVolumeReductionValue(); + updateVolumeAdaptationValue(); EventBus.getDefault().post( new VolumeAdaptionChangedEvent(feedPreferences.getVolumeAdaptionSetting(), feed.getId())); return false; }); } - private void updateVolumeReductionValue() { - ListPreference volumeReductionPreference = findPreference("volumeReduction"); + private void updateVolumeAdaptationValue() { + ListPreference volumeAdaptationPreference = findPreference("volumeReduction"); switch (feedPreferences.getVolumeAdaptionSetting()) { case OFF: - volumeReductionPreference.setValue("off"); + volumeAdaptationPreference.setValue("off"); break; case LIGHT_REDUCTION: - volumeReductionPreference.setValue("light"); + volumeAdaptationPreference.setValue("light"); break; case HEAVY_REDUCTION: - volumeReductionPreference.setValue("heavy"); + volumeAdaptationPreference.setValue("heavy"); + break; + case LIGHT_BOOST: + volumeAdaptationPreference.setValue("light_boost"); + break; + case MEDIUM_BOOST: + volumeAdaptationPreference.setValue("medium_boost"); + break; + case HEAVY_BOOST: + volumeAdaptationPreference.setValue("heavy_boost"); break; } } diff --git a/app/src/main/res/xml/feed_settings.xml b/app/src/main/res/xml/feed_settings.xml index 619ab6296..fb9e2e425 100644 --- a/app/src/main/res/xml/feed_settings.xml +++ b/app/src/main/res/xml/feed_settings.xml @@ -50,12 +50,12 @@ <de.danoeh.antennapod.preferences.MaterialListPreference android:defaultValue="off" - android:entries="@array/spnVolumeReductionItems" - android:entryValues="@array/spnVolumeReductionValues" + android:entries="@array/spnVolumeAdaptationItems" + android:entryValues="@array/spnVolumeAdaptationValues" android:icon="@drawable/ic_volume_adaption" android:key="volumeReduction" - android:summary="@string/feed_volume_reduction_summary" - android:title="@string/feed_volume_reduction" /> + android:summary="@string/feed_volume_adaptation_summary" + android:title="@string/feed_volume_adapdation" /> <de.danoeh.antennapod.preferences.MaterialListPreference android:entries="@array/feedNewEpisodesActionItems" |