-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide volume boost options when not supported
- Loading branch information
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
app/src/main/java/de/danoeh/antennapod/preferences/VolumeAdaptationPreference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.BOOST_SUPPORTED) { | ||
return super.getEntries(); | ||
} else { | ||
return Arrays.copyOfRange(super.getEntries(), 0, 3); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters