Disable duration text box when checkbox is off
This commit is contained in:
parent
ef97411fbb
commit
95eae1519a
|
@ -28,11 +28,15 @@ public abstract class EpisodeFilterDialog extends MaterialAlertDialogBuilder {
|
||||||
setTitle(R.string.episode_filters_label);
|
setTitle(R.string.episode_filters_label);
|
||||||
setView(viewBinding.getRoot());
|
setView(viewBinding.getRoot());
|
||||||
|
|
||||||
|
viewBinding.durationCheckBox.setOnCheckedChangeListener(
|
||||||
|
(buttonView, isChecked) -> viewBinding.episodeFilterDurationText.setEnabled(isChecked));
|
||||||
if (filter.hasMinimalDurationFilter()) {
|
if (filter.hasMinimalDurationFilter()) {
|
||||||
viewBinding.durationCheckBox.setChecked(true);
|
viewBinding.durationCheckBox.setChecked(true);
|
||||||
// Store minimal duration in seconds, show in minutes
|
// Store minimal duration in seconds, show in minutes
|
||||||
viewBinding.episodeFilterDurationText
|
viewBinding.episodeFilterDurationText
|
||||||
.setText(String.valueOf(filter.getMinimalDurationFilter() / 60));
|
.setText(String.valueOf(filter.getMinimalDurationFilter() / 60));
|
||||||
|
} else {
|
||||||
|
viewBinding.episodeFilterDurationText.setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter.excludeOnly()) {
|
if (filter.excludeOnly()) {
|
||||||
|
|
Loading…
Reference in New Issue