title: Remove White Background in Bottom Sheet Dialog Fragment
body: <p>How to remove white background in bottom sheet dialog fragment?</p>
  
  <p>I have tried the answer in <a href="https://stackoverflow.com/questions/28528121/remove-white-background-in-dialogfragment">this</a> or set the background in the layout xml to transparent, but still get this result</p>
  
  <p><a href="https://i.stack.imgur.com/8qfoR.png" rel="noreferrer"><img src="https://i.stack.imgur.com/8qfoR.png" alt="enter image description here"></a></p>
  
  <p>Here is my code</p>
  
  <pre><code>public class BottomSheetFragment extends BottomSheetDialogFragment {
  
  private Record record;
  
  private MainFragment fragment;
  
  public static BottomSheetFragment getInstance() {
      return new BottomSheetFragment ();
  }
  
  public BottomSheetFragment setRecord(Record record) {
      this.record = record;
      return this;
  }
  
  public BottomSheetFragment setFragment(MainFragment fragment) {
      this.fragment = fragment;
      return this;
  }
  
  @TargetApi(Build.VERSION_CODES.O)
  @Override
  public void onViewCreated(View view, @Nullable final Bundle savedInstanceState) {
      super.onViewCreated(view, savedInstanceState);
  
      getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
      getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT);
      setStyle(DialogFragment.STYLE_NO_FRAME, android.R.style.Theme);
  
      //Set content
  }
  
  @Nullable
  @Override
  public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
      return inflater.inflate(R.layout.layout_bottom_sheet, container);
  }
  
  @Override
  public void onCreate(@Nullable Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
  }
  }
  </code></pre>
  
  <p>layout_bottom_sheet.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:id="@+id/cardView"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_marginTop="60dp"
  android:background="@drawable/bg_cardboard"&gt;
  
  &lt;/FrameLayout&gt;
  </code></pre>