Round corner for BottomSheetDialogFragment

rounded bottom sheet android github
bottomsheetdialog vs bottomsheetdialogfragment
custom bottom sheet dialog android example
bottom sheet rounded corners flutter
bottomsheetdialogfragment padding
custom bottom sheet dialog android github
bottomsheetdialogfragment transparent background
bottomsheetdialogfragment rounded

i have an custom BttomSheetDialogFragment and i want to have round corners in top of Bottom View

this is my Custom class that inflating my layout that i want to appear from bottom

View mView;

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    mView = inflater.inflate(R.layout.charge_layout, container, false);
    return mView;

and also i have this xml resource file as background :

<shape xmlns:android=""
<corners android:topRightRadius="35dp"
<solid android:color="@color/white"/>

<padding android:top="10dp"

but the problem is, when i set this resource file as background of my Layout's root element , the corners still are not rounded

and i can't use below code :


cuz its override default background of BottomSheetDialog and there wont be any semi-transparent gray color above my Bottom View

Create a custom drawable rounded_dialog.xml:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android=""
    <solid android:color="@android:color/white"/>
    <corners android:topLeftRadius="16dp"


Then override bottomSheetDialogTheme on styles.xml using the drawable as background:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">       
    <item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item>

<style name="AppBottomSheetDialogTheme"
    <item name="bottomSheetStyle">@style/AppModalStyle</item>

<style name="AppModalStyle"
    <item name="android:background">@drawable/rounded_dialog</item>

This will change all the BottomSheetDialogs of your app.

How to put rounded corners in a BottomSheetDialogFragment , I have problems trying to put rounded edges, since I show it as modal, and I want its upper corners to be rounded, I find examples but  I have problems trying to put rounded edges, since I show it as modal, and I want its upper corners to be rounded, I find examples but everything is for Android-Java, apart because I see that they create a style-v21 file, but I don't know how to use it

The BottomSheetDialog is setting a default white background color , this is why the corners are not visible, In order to show them you need to make the background of the dialog transparent by overriding the style of the BottomSheetDialog.

Define this style In your res/values/styles/styles.xml

<style name="BottomSheetDialog" parent="Theme.Design.Light.BottomSheetDialog">
    <item name="bottomSheetStyle">@style/bottomSheetStyleWrapper</item>

<style name="bottomSheetStyleWrapper" parent="Widget.Design.BottomSheet.Modal">
    <item name="android:background">@android:color/transparent</item>

And set this style to your BottomSheetDialog

View view = getLayoutInflater().inflate(R.layout.chooser_bottom_sheet, null);
BottomSheetDialog dialog = new BottomSheetDialog(this,; // Style here

Rounded modal bottom sheet as seen in new Google products , Rounded modal bottom sheet as seen in new Google products(Tasks, News, etc <corners. android:topLeftRadius="@dimen/bottom_sheet_corner_radius" open class RoundedBottomSheetDialogFragment : BottomSheetDialogFragment​()  I am using this solution to round corners of dialog in BottomSheetDialogFragment and it works fine with API 21 and higher. But in Api < 21 it removes the background and the rounded background goes away. How to make the background rounded in API < 21? If it is not possible to change the background, please help me change the background color instead.

With the new Material Component library you can customize the shape of your component using the shapeAppearanceOverlay attribute in your style.

Just use the BottomSheetDialogFragment overriding the onCreateView method and then define your custom style for Bottom Sheet Dialogs.

Define the bottomSheetDialogTheme attribute in styles.xml in your app theme:

  <!-- Base application theme. -->
  <style name="AppTheme" parent="Theme.MaterialComponents.Light">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="bottomSheetDialogTheme">@style/CustomBottomSheetDialog</item>

Then just define your favorite shape with shapeAppearanceOverlay

  <style name="CustomBottomSheetDialog" parent="@style/ThemeOverlay.MaterialComponents.BottomSheetDialog">
    <item name="bottomSheetStyle">@style/CustomBottomSheet</item>

  <style name="CustomBottomSheet" parent="Widget.MaterialComponents.BottomSheet">
    <item name="shapeAppearanceOverlay">@style/CustomShapeAppearanceBottomSheetDialog</item>

  <style name="CustomShapeAppearanceBottomSheetDialog" parent="">
    <item name="cornerFamily">rounded</item>
    <item name="cornerSizeTopRight">16dp</item>
    <item name="cornerSizeTopLeft">16dp</item>
    <item name="cornerSizeBottomRight">0dp</item>
    <item name="cornerSizeBottomLeft">0dp</item>

It requires the version 1.1.0 (currently the latest version is 1.1.0-beta02).

Implementing Google's refreshed modal bottom sheet, for Android, then implementing this rounded corner bottom sheet got much easier. Rounded BottomSheetDialog fragment without dimmed Modal bottom sheet. This is a version of DialogFragment that shows a bottom sheet using BottomSheetDialog instead of a floating dialog. Inherited constants. From class Public constructors. BottomSheetDialogFragment ()

I was checking the same thing today and yes you were right about following code


this applies to fragment background, so instead you should get the bottomsheet view from dialog window and change the background here is the code

    public void setupDialog(Dialog dialog, int style) {
        super.setupDialog(dialog, style);
        View rootView = getActivity().getLayoutInflater().inflate(R.layout.view_member_info,null,false);
        unbinder = ButterKnife.bind(this, rootView);
        FrameLayout bottomSheet = (FrameLayout) dialog.getWindow().findViewById(;

here bottomsheet is the actual view you want to change.

RoundedCornerTreatment, i have an custom BttomSheetDialogFragment and i want to have round corners in top of Bottom View this is my Custom class that inflating my layout that i want to  Thanks for opening project, but I think there are some parts that missing. File google-services.json is missing. The Google Services Plugin cannot function without it.

create a shape named rounded_corners_shape

<shape xmlns:android=""
    <solid android:color="@color/white"/>


define a style

  <style name="AppBottomSheetDialogTheme"
        <item name="bottomSheetStyle">@style/AppModalStyle</item>

    <style name="AppModalStyle" parent="Widget.Design.BottomSheet.Modal">
        <item name="android:background">@drawable/rounded_corners_shape</item>

use this style on your custom BottomSheetDialogFragment like this, it will be work!

 public class CustomDialogFragment extends BottomSheetDialogFragment {
      public void onCreate(@Nullable Bundle savedInstanceState) {
        setStyle(STYLE_NORMAL, AppBottomSheetDialogTheme);


Android BottomSheetDialogFragment has color behind rounded , i have an custom BttomSheetDialogFragment and i want to have round corners in top of Bottom View. this is my Custom class that inflating my  AutoCompleTextView + BottomSheetDialogFragment + CustomAdapter Rubens Armôa Lopes. CorelDraw X7- How to design an Amazing Round Logo - Duration: 26:32. Akin The Computer Guy Recommended

Applying shape to UI, float : the radius, in pixels, of the rounded corner, which is rendered as a quarter circle. Public methods. getCornerPath. void getCornerPath (  In this tutorial we will learn, how to create a modal bottom sheet, by subclassing BottomSheetDialogFragment. Our sheet will have a custom layout and it will be able to communicate back to the

BottomSheetDialogFragment view becomes transparent only after , Android BottomSheetDialogFragment has color behind rounded corners You have to change the bottom sheet theme to achieve the top round layout Create a​  With the Arrival of the new version 23.2 of library support Android brings a new component that can enrich the user interface of some of our applications, calls Bottom Sheets. You can find a detailed description of this component in the guides design of Material design. What is Bottom Sheets ? A bottom sheet is Continue Reading

Components can apply one of two styles to the shapes of their corners: Rounded corner; Cut corner. A rounded corner. Android Bottom Sheet component slides up from the bottom showing more relevant content. You can notice bottom sheets in apps like map apps (bottom sheet reveals location, directions information), music players (Play bar sticks to bottom and opens when swipe up). The bottom sheet is the component of android design support library.