diff options
author | ByteHamster <info@bytehamster.com> | 2024-02-18 19:05:13 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2024-02-18 19:05:13 +0100 |
commit | 0d29e44de5ac97f2285aca241e4f4290c26ea0f9 (patch) | |
tree | be56da0e2381b7a2abc43b2401fb7bfca1d03503 /app/src/main | |
parent | 556597a17315a6966a940e24e53088f8a31ef018 (diff) | |
parent | bf6721842220d7e89a0c3a451f5965e57feb9ca0 (diff) | |
download | AntennaPod-0d29e44de5ac97f2285aca241e4f4290c26ea0f9.zip |
Merge branch 'master' into develop
Diffstat (limited to 'app/src/main')
3 files changed, 29 insertions, 2 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java index 1a2b6438f..003ee23db 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java @@ -491,7 +491,7 @@ public class QueueFragment extends Fragment implements MaterialToolbar.OnMenuIte } info += " • "; info += getString(R.string.time_left_label); - info += Converter.getDurationStringLocalized(getActivity(), timeLeft); + info += Converter.getDurationStringLocalized(getResources(), timeLeft, false); } infoBar.setText(info); } diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/VolumeAdaptationPreference.java b/app/src/main/java/de/danoeh/antennapod/preferences/VolumeAdaptationPreference.java new file mode 100644 index 000000000..584b7d90e --- /dev/null +++ b/app/src/main/java/de/danoeh/antennapod/preferences/VolumeAdaptationPreference.java @@ -0,0 +1,27 @@ +package de.danoeh.antennapod.preferences; + +import android.content.Context; +import android.util.AttributeSet; + +import java.util.Arrays; + +import de.danoeh.antennapod.model.feed.VolumeAdaptionSetting; + +public class VolumeAdaptationPreference extends MaterialListPreference { + public VolumeAdaptationPreference(Context context) { + super(context); + } + + public VolumeAdaptationPreference(Context context, AttributeSet attrs) { + super(context, attrs); + } + + @Override + public CharSequence[] getEntries() { + if (VolumeAdaptionSetting.isBoostSupported()) { + return super.getEntries(); + } else { + return Arrays.copyOfRange(super.getEntries(), 0, 3); + } + } +} diff --git a/app/src/main/res/xml/feed_settings.xml b/app/src/main/res/xml/feed_settings.xml index fb9e2e425..b322217ad 100644 --- a/app/src/main/res/xml/feed_settings.xml +++ b/app/src/main/res/xml/feed_settings.xml @@ -48,7 +48,7 @@ android:summary="@string/global_default" android:title="@string/auto_delete_label" /> - <de.danoeh.antennapod.preferences.MaterialListPreference + <de.danoeh.antennapod.preferences.VolumeAdaptationPreference android:defaultValue="off" android:entries="@array/spnVolumeAdaptationItems" android:entryValues="@array/spnVolumeAdaptationValues" |