0

I have have an activity who have black transparent overlay.

What I need to do is remove overlay for specific button in an activity.But all other part extract button will consist of an overlay.

Anamika Chavan
  • 149
  • 1
  • 3
  • 14
  • not clear about what you are asking.. – Vikram Singh Jan 01 '18 at 11:18
  • Add a dummy button in front of overlay layout in exact same position of your actual button. Hide the transparent overlay and dummy button on click of Dummy button – BarmanInfo Jan 01 '18 at 11:20
  • did u asking like One button can overlay other one button – ND1010_ Jan 01 '18 at 11:21
  • @ND1010_ No, I am asking there is black overlay dialog box and behind that there is an activity which consist of a button.I want to show that overlay dialog box as well as a button which is hide by overlay.So how to only show that button? – Anamika Chavan Jan 02 '18 at 05:31
  • ok understand what you are asking about you have One activity in that activity having one button on click of that button open a Dialogbox when Dialog box will open then it self and also showing button that in activity right ? – ND1010_ Jan 02 '18 at 05:37
  • HAlf right,Activity will open will an overlay of dialog box,But Activity will consist of button that i need to show on overlay – Anamika Chavan Jan 02 '18 at 05:42

1 Answers1

0

You can add a view with black overlay. Use of RelativeLayout is a great solution.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
 xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:background="@mipmap/ic_launcher">
   <Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Press Me"/>
   <View
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#8000"/>
</RelativeLayout>

Hope this helps.

Thanks.

Chintan Joshi
  • 1,207
  • 1
  • 9
  • 17