1

I Created a New Activity abc.xml with Custom Shape which is called When the Plus Button was Clicked in the previous Activity and i want this (abc.xml) layout in opacity how we achieve This in Android

enter image description here

res/drawable/recshape.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item>
        <shape android:shape="rectangle">

        </shape>
    </item>
    <item
        android:top="100dp"
        android:bottom="0dp"
        android:left="-70dp"
        android:right="-70dp">

        <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:innerRadius="50dp"
            android:shape="rectangle"
            android:useLevel="true">

            <solid android:color="@color/colorPrimary"/>
            <corners

                android:bottomLeftRadius="0dp"
                android:topLeftRadius="250dp"
                android:topRightRadius="250dp"/>

        </shape>
    </item>

</layer-list>

Manifest.xml

<activity android:name=".NewListCreate" android:theme="@style/AppFullScreenTheme" />

res/values/styles.xml

<style name="AppFullScreenTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">false</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowContentOverlay">@null</item>

    </style>

abc.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    android:background = "@drawable/rounded_drawable" >
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="200dp"
    android:layout_centerHorizontal="true"

    >
    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/close"
        android:src="@drawable/ic_close"
        android:layout_marginTop="150dp"
        android:layout_marginLeft="40dp"
        android:layout_marginStart="40dp"
        android:contentDescription="@null"
        />
    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/list_name"
        android:hint="@string/enter_your_list_name"
        android:layout_marginTop="150dp"
        android:autofillHints="@null"
        android:layout_toRightOf="@+id/close"
        android:layout_toEndOf="@+id/close"
        android:layout_marginLeft="10dp"
        android:layout_marginStart="10dp"
        android:textColor="@color/colorWhite"
        android:textColorHint="@color/colorWhite"
        android:inputType="text"
        />
    <ImageButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/done"
        android:src="@drawable/ic_check_circle"
        android:layout_marginTop="150dp"
        android:contentDescription="@null"
        android:layout_toEndOf="@+id/list_name"
        android:layout_toRightOf="@+id/list_name"

        android:layout_marginRight="40dp"
        android:layout_marginEnd="40dp"
        />
</RelativeLayout>
    </RelativeLayout>

i found Some answer related this like to add <solid android:color="#30646464" /> or android:theme="@android:style/Theme.Translucent" in styles.xml under values and my problem was not solved

Karthickyuvan
  • 428
  • 2
  • 16
  • 1
    if your are looking for transparent activity , this may help you https://stackoverflow.com/questions/2176922/how-do-i-create-a-transparent-activity-on-android – darwin Aug 09 '20 at 12:22
  • when i add ` @android:color/transparent ` the white bg was transfered into black but it doesnot transfered into tranparent also i cant able to use `android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"` in my manifest bcoz i style me theme in styles.xml as `parent="Theme.AppCompat.Light.NoActionBar" ` and i used that name in manifest – Karthickyuvan Aug 09 '20 at 12:44
  • 1
    Maybe you don't need a second activity. It would be easier if you used a bottom sheet. https://material.io/components/sheets-bottom – einUsername Aug 09 '20 at 15:27
  • https://stackoverflow.com/a/53474535/5155305 i just follow this One and it works but When i use the Above Code the transparent was Working Perfect But it doesnt display the opacity of the previous activity it Display the Bg of my Home Screen ( wallpeper Screen ) [link]https://i.stack.imgur.com/rQzd2.jpg if u know Why Pls Help me – Karthickyuvan Aug 09 '20 at 16:02
  • The first activity is moved to inactive state when a new activity is started. You cannot have two activities alive at same time. – darwin Aug 10 '20 at 03:40
  • You may better use a full screen transparent dialog instead of second activity – darwin Aug 10 '20 at 03:41

0 Answers0