0

I have an app which contains layout with a Linear layout with some views. What I want to make main layout background color transparent so that when I launch the app then I must be able to see transparent layout no any color. How do I do that

code:-

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/bottomSheet"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorPrimary"
android:orientation="vertical">

<de.hdodenhof.circleimageview.CircleImageView
    android:id="@+id/img_Camera"
    android:layout_width="50dp"
    android:layout_height="50dp"
    android:layout_gravity="center_horizontal|bottom"
    android:layout_marginTop="10dp"
    android:src="@drawable/amazon"
    app:civ_border_color="@color/textColor"
    app:civ_border_width="5dp"
    app:civ_fill_color="@color/colorPrimary" />

<android.support.v7.widget.RecyclerView
    android:id="@+id/notification_list"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_marginTop="8dp" />
<FrameLayout
    android:layout_width="wrap_content"
    android:layout_height="30dp">

</FrameLayout>

NIraj Kumar
  • 115
  • 2
  • 6
  • android:background="@android:color/transparent" – Sahdeep Singh Jan 06 '18 at 12:52
  • Possible duplicate of [How do I create a transparent Activity on Android?](https://stackoverflow.com/questions/2176922/how-do-i-create-a-transparent-activity-on-android) – Goku Jan 06 '18 at 13:10

3 Answers3

0

Specify the Activity to be Translucent in the manifest:

<activity ... 
      android:theme="@android:style/Theme.Translucent" 
      .../>
aliaksei
  • 714
  • 1
  • 9
  • 23
0

Change LinearLayout background attribute to.

"@android:color/transparent"
Dheeraj Rijhwani
  • 351
  • 5
  • 18
0

To see the Device screen you have to make the LinearLayout and the background of the activity both transparent. Try this:

How do I create a transparent Activity on Android?

Subrata Mondal
  • 822
  • 7
  • 17