diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ItemFilterDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ItemFilterDialog.java index 0118eb74e..a122a7cec 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/ItemFilterDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/ItemFilterDialog.java @@ -1,24 +1,31 @@ package de.danoeh.antennapod.dialog; +import android.app.Dialog; import android.os.Bundle; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; +import android.widget.FrameLayout; import android.widget.LinearLayout; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; + +import com.google.android.material.bottomsheet.BottomSheetBehavior; +import com.google.android.material.bottomsheet.BottomSheetDialog; import com.google.android.material.bottomsheet.BottomSheetDialogFragment; import com.google.android.material.button.MaterialButtonToggleGroup; + +import java.util.HashSet; +import java.util.Set; + import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.FeedItemFilterGroup; import de.danoeh.antennapod.databinding.FilterDialogRowBinding; import de.danoeh.antennapod.model.feed.FeedItemFilter; -import java.util.HashSet; -import java.util.Set; - public abstract class ItemFilterDialog extends BottomSheetDialogFragment { protected static final String ARGUMENT_FILTER = "filter"; @@ -54,6 +61,27 @@ public abstract class ItemFilterDialog extends BottomSheetDialogFragment { return layout; } + @NonNull + @Override + public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { + Dialog dialog = super.onCreateDialog(savedInstanceState); + dialog.setOnShowListener(dialogInterface -> { + BottomSheetDialog bottomSheetDialog = (BottomSheetDialog) dialogInterface; + setupFullHeight(bottomSheetDialog); + }); + return dialog; + } + + private void setupFullHeight(BottomSheetDialog bottomSheetDialog) { + FrameLayout bottomSheet = (FrameLayout) bottomSheetDialog.findViewById(R.id.design_bottom_sheet); + if (bottomSheet != null) { + BottomSheetBehavior behavior = BottomSheetBehavior.from(bottomSheet); + ViewGroup.LayoutParams layoutParams = bottomSheet.getLayoutParams(); + bottomSheet.setLayoutParams(layoutParams); + behavior.setState(BottomSheetBehavior.STATE_EXPANDED); + } + } + protected Set getNewFilterValues() { final Set newFilterValues = new HashSet<>(); for (int i = 0; i < rows.getChildCount(); i++) {