Skip to content

Commit

Permalink
[Catalog] Applied edge-to-edge to preferences bottom sheet
Browse files Browse the repository at this point in the history
Resolves #3123
Resolves #3122

GIT_ORIGIN_REV_ID=fd094876551f8106c5cc57c46f2b3c6ffa3a7113
PiperOrigin-RevId: 492262956

(cherry picked from commit 695fb4a)
  • Loading branch information
manabu-nakamura authored and dsn5ft committed Dec 9, 2022
1 parent f7b3aac commit c440d86
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -18,6 +18,7 @@

import io.material.catalog.R;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.util.SparseIntArray;
Expand All @@ -37,6 +38,7 @@
import dagger.android.HasAndroidInjector;
import dagger.android.support.AndroidSupportInjection;
import io.material.catalog.preferences.CatalogPreference.Option;
import io.material.catalog.windowpreferences.WindowPreferencesManager;
import javax.inject.Inject;

/**
Expand All @@ -51,6 +53,14 @@ public class CatalogPreferencesDialogFragment extends BottomSheetDialogFragment

private final SparseIntArray buttonIdToOptionId = new SparseIntArray();

@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
Dialog dialog = super.onCreateDialog(savedInstanceState);
new WindowPreferencesManager(requireContext()).applyEdgeToEdgePreference(dialog.getWindow());
return dialog;
}

@Override
public void onAttach(Context context) {
AndroidSupportInjection.inject(this);
Expand Down

0 comments on commit c440d86

Please sign in to comment.