3

I am inflating a view using Dialog Fragment.Everything works fine till API 23+ but when I am testing it on API 19, I am getting a blue line over my view.I can not even find the color of this line in my color.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#B3000000"
android:orientation="vertical">
<TextView
    android:id="@+id/add_text_done_tv"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentEnd="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:layout_margin="20dp"
    android:background="@drawable/rounded_border_text_view"
    android:padding="10dp"
    android:text="Done"
    android:textAllCaps="false"
    android:textColor="@color/white"
    android:textSize="15sp" />

<EditText
    android:id="@+id/add_text_edit_text"
    style="@style/EditText"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_above="@+id/add_text_color_picker_relative_layout"
    android:layout_below="@+id/add_text_done_tv"
    android:background="@null"
    android:gravity="center"
    android:inputType="textMultiLine"
    android:textSize="40sp" />

<LinearLayout
    android:id="@+id/add_text_color_picker_relative_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_alignParentBottom="true">

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/add_text_font_picker_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        tools:background="@android:color/black"
        tools:listitem="@layout/font_picker_list_item" />

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/add_text_color_picker_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
        tools:background="@android:color/black"
        tools:listitem="@layout/color_picker_item_list" />


</LinearLayout>

</RelativeLayout>

I have added this code in my class onStart() to set the size of layout.

        int width = ViewGroup.LayoutParams.MATCH_PARENT;
        int height = ViewGroup.LayoutParams.MATCH_PARENT;
        dialog.getWindow().setLayout(width, height);
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));

This is the image of my problem.

Hritik Gupta
  • 611
  • 5
  • 20

2 Answers2

1

The following is your answer.

https://stackoverflow.com/a/37738741/9224262

Also I think you should have searched first. Anyway good luck.

Faisal Ahmed
  • 115
  • 6
1

You should hide the title:

dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);