title: Android - set style for dialog fragment
body: <p>i want to create fragment dialog with black windowBackground around it, but when i add a style i have a black frame around the fragment. does somebody knows why this frame is appears in my fragment:</p>
  
  <p><a href="https://i.stack.imgur.com/WjAUL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WjAUL.png" alt="Fragment example"></a></p>
  
  <p>this my fragment xml:</p>
  
  <pre><code>  `  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:id="@+id/tocLayout"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:background="@drawable/clean_backgroung_pop_up_ltr"
      android:padding="20dp"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@drawable/settings_border"
          android:orientation="vertical"&gt;
  
          &lt;FrameLayout
              android:id="@+id/title_layout_settings"
              style="@style/reader_dialog_title"&gt;
  
              &lt;TextView
                  android:id="@+id/title_txt_settings"
                  android:layout_width="wrap_content"
                  android:layout_height="match_parent"
                  android:layout_gravity="center"
                  android:layout_weight="4"
                  android:gravity="center"
                  android:text="@string/menu_settings"
                  android:textColor="@color/white_color"
                  android:textSize="@dimen/global_text_size" /&gt;
  
              &lt;ImageView
                  android:id="@+id/imvClose"
                  android:layout_width="@dimen/global_close_button_width"
                  android:layout_height="match_parent"
                  android:layout_gravity="center_vertical|right"
                  android:layout_weight="1"
                  android:padding="@dimen/global_padding"
                  android:src="@drawable/icon_close_window" /&gt;
  
              &lt;ImageView
                  android:id="@+id/title_txt_settings_icon"
                  android:layout_width="@dimen/global_image_width"
                  android:layout_height="match_parent"
                  android:layout_gravity="center_vertical|left"
                  android:layout_weight="1"
                  android:padding="@dimen/global_padding"
                  android:scaleType="center"
                  android:src="@drawable/toolbar_settings_button_heb" /&gt;
          &lt;/FrameLayout&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:orientation="vertical"
              android:paddingLeft="@dimen/global_margin_s"
              android:paddingRight="@dimen/global_margin_s"&gt;
  
              &lt;FrameLayout
                  android:id="@+id/tts_layout_settings"
                  android:layout_width="@dimen/settings_screen_popover_width"
                  android:layout_height="@dimen/settings_screen_layout_height"
                  android:gravity="center_horizontal"
                  android:longClickable="true"&gt;
  
                  &lt;ImageView
                      android:layout_width="wrap_content"
                      android:layout_height="@dimen/settings_screen_seek_bar_hight"
                      android:layout_centerHorizontal="true"
                      android:layout_gravity="center"
                      android:background="@drawable/tts_rabbit_turtle"
                      android:gravity="center_horizontal" /&gt;
  
                  &lt;SeekBar
                      android:id="@+id/tts_speed_settings_seek"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_centerHorizontal="true"
                      android:layout_gravity="center"
                      android:layout_marginLeft="@dimen/global_book_reader_menus_margin_l"
                      android:layout_marginRight="@dimen/global_book_reader_menus_margin_l"
                      android:max="4"
                      android:maxHeight="1dp"
                      android:progressDrawable="@drawable/seek_bar"
                      android:thumb="@drawable/sliderknob_23" /&gt;
              &lt;/FrameLayout&gt;
  
              &lt;View
                  android:id="@+id/setting_seperator"
                  android:layout_width="@dimen/settings_screen_popover_width"
                  android:layout_height="1dp"
                  android:layout_below="@id/tts_speed_settings_seek"
                  android:background="#CECECE"
                  android:drawablePadding="@dimen/global_margin_s" /&gt;
  
              &lt;FrameLayout
                  android:id="@+id/brightness_layout_settings"
                  android:layout_width="@dimen/settings_screen_popover_width"
                  android:layout_height="@dimen/settings_screen_layout_height"&gt;
  
                  &lt;ImageView
                      android:layout_width="wrap_content"
                      android:layout_height="@dimen/settings_screen_seek_bar_hight"
                      android:layout_centerHorizontal="true"
                      android:layout_gravity="center"
                      android:background="@drawable/bright"
                      android:gravity="center_horizontal" /&gt;
  
                  &lt;SeekBar
                      android:id="@+id/brightness_settings_seek"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center"
                      android:layout_marginLeft="@dimen/global_book_reader_menus_margin_l"
                      android:layout_marginRight="@dimen/global_book_reader_menus_margin_l"
                      android:backgroundTint="@color/application_gray"
                      android:maxHeight="1dp"
                      android:progressDrawable="@drawable/seek_bar"
                      android:thumb="@drawable/sliderknob_23" /&gt;
              &lt;/FrameLayout&gt;
  
              &lt;View
                  android:layout_width="@dimen/settings_screen_popover_width"
                  android:layout_height="1dp"
                  android:layout_below="@+id/brightness_settings_seek"
                  android:background="#CECECE"
                  android:drawablePadding="@dimen/global_margin_s"
                  android:gravity="center" /&gt;
  
  
              &lt;FrameLayout
                  android:layout_width="match_parent"
                  android:layout_height="@dimen/settings_screen_sub_layout_height"&gt;
  
                  &lt;Switch
                      android:id="@+id/switchHighlights"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="right|center_vertical" /&gt;
  
                  &lt;TextView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="left|center_vertical"
                      android:text="@string/show_highlights_info"
                      android:textAppearance="?android:attr/textAppearanceMedium"
                      android:textColor="@color/settings_text_color"
                      android:id="@+id/txvShowHighligtsInfo" /&gt;
              &lt;/FrameLayout&gt;
  
              &lt;View
                  android:layout_width="@dimen/settings_screen_popover_width"
                  android:layout_height="1dp"
                  android:layout_below="@+id/brightness_settings_seek"
                  android:background="#CECECE"
                  android:drawablePadding="@dimen/global_margin_s"
                  android:gravity="center" /&gt;
  
  
              &lt;FrameLayout
                  android:layout_width="match_parent"
                  android:layout_height="@dimen/settings_screen_sub_layout_height"&gt;
  
                  &lt;Switch
                      android:id="@+id/switchTheme"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="right|center_vertical" /&gt;
  
                  &lt;TextView
                      android:id="@+id/txvNightTheme"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="left|center_vertical"
                      android:text="@string/search_popup_night_theme_txt"
                      android:textAppearance="?android:attr/textAppearanceMedium"
                      android:textColor="@color/settings_text_color" /&gt;
              &lt;/FrameLayout&gt;
  
              &lt;View
                  android:layout_width="@dimen/settings_screen_popover_width"
                  android:layout_height="1dp"
                  android:layout_below="@+id/brightness_settings_seek"
                  android:background="#CECECE"
                  android:drawablePadding="@dimen/global_margin_s"
                  android:gravity="center" /&gt;
  
              &lt;FrameLayout
                  android:layout_width="match_parent"
                  android:layout_height="@dimen/settings_screen_sub_layout_height"&gt;
  
                  &lt;Switch
                      android:id="@+id/switchLockScreen"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="right|center_vertical" /&gt;
  
                  &lt;!--       &lt;android.support.v7.widget.SwitchCompat
                             android:id="@+id/switchLockScreen"
                             android:layout_width="153dp"
                             android:layout_height="wrap_content"
                             android:layout_gravity="center_vertical|left"
                             android:theme="@style/MySwitch" /&gt;   --&gt;
  
                  &lt;TextView
                      android:id="@+id/txvLockScreen"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="left|center_vertical"
                      android:text="@string/search_popup_lock_screen_txt"
                      android:textAppearance="?android:attr/textAppearanceMedium"
                      android:textColor="@color/settings_text_color" /&gt;
              &lt;/FrameLayout&gt;
  
  
          &lt;/LinearLayout&gt;
  
  
      &lt;/LinearLayout&gt;
  
      &lt;!-- Font seek bar  --&gt;
  
      &lt;!-- Brighness --&gt;
  
      &lt;!--Night mode--&gt;
  
  
  &lt;/LinearLayout&gt;`
  </code></pre>
  
  <p>this is my style:</p>
  
  <p><code>&lt;style name="MyDialog" parent="@android:style/Theme.DeviceDefault.Light.Dialog"&gt;
          &lt;item name="android:windowBackground"&gt;@color/trans_black_second&lt;/item&gt;
     &lt;/style&gt;</code></p>
  
  <p>this is how i set it in the DialogFragment:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Log.i(TAG,"BookDialog onCreate");
      setCancelable(true);
      if ( mBookReader != null &amp;&amp; inflater == null) {
          inflater = (LayoutInflater) mBookReader.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          mWindowManager = (WindowManager)mBookReader.getSystemService(Context.WINDOW_SERVICE);
      }
      tfOpenSansHebrew =  FontUtils.getFont(getActivity(), FontUtils.FONT_OPEN_SANS);
  
      setStyle(DialogFragment.STYLE_NO_FRAME, R.style.MyDialog);
  
  }
  </code></pre>