Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Catalog] Applied edge-to-edge to bottom sheet #4001

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.google.android.material.button.MaterialButton;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import io.material.catalog.feature.DemoFragment;
import io.material.catalog.windowpreferences.WindowPreferencesManager;

/** A base class for Shape Theming demos in the Catalog app. */
public abstract class ShapeThemingDemoFragment extends DemoFragment {
Expand Down Expand Up @@ -91,7 +92,10 @@ public View onCreateDemoView(
View bottomSheetInternal = bottomSheetDialog.findViewById(R.id.design_bottom_sheet);
BottomSheetBehavior.from(bottomSheetInternal).setPeekHeight(300);
MaterialButton button = container.findViewById(R.id.material_button_2);
button.setOnClickListener(v -> bottomSheetDialog.show());
button.setOnClickListener(v -> {
new WindowPreferencesManager(requireContext()).applyEdgeToEdgePreference(bottomSheetDialog.getWindow());
bottomSheetDialog.show();
});

return view;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.google.android.material.snackbar.Snackbar;
import io.material.catalog.feature.DemoFragment;
import io.material.catalog.feature.DemoUtils;
import io.material.catalog.windowpreferences.WindowPreferencesManager;
import java.util.List;

/** A fragment that displays a Toolbar Top App Bar demo for the Catalog app. */
Expand Down Expand Up @@ -76,6 +77,7 @@ public boolean onOptionsItemSelected(@NonNull MenuItem menuItem) {
if (menuItem.getItemId() == R.id.configure_toolbars) {
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(requireContext());
bottomSheetDialog.setContentView(createConfigureToolbarsView(bottomSheetDialog));
new WindowPreferencesManager(requireContext()).applyEdgeToEdgePreference(bottomSheetDialog.getWindow());
bottomSheetDialog.show();
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package io.material.catalog.transition;

import io.material.catalog.R;
import io.material.catalog.windowpreferences.WindowPreferencesManager;

import android.annotation.SuppressLint;
import android.content.Context;
Expand Down Expand Up @@ -88,6 +89,7 @@ void showConfigurationChooser(Context context, @Nullable OnDismissListener onDis
bottomSheetDialog.setContentView(
createConfigurationBottomSheetView(context, bottomSheetDialog));
bottomSheetDialog.setOnDismissListener(onDismissListener);
new WindowPreferencesManager(context).applyEdgeToEdgePreference(bottomSheetDialog.getWindow());
bottomSheetDialog.show();
}

Expand Down