Android: creating full screen semi transparent overlay with z-order

I am trying to create a full screen semi-transparent overlay that displays in response to a Float Action button click, similar to Google Keep. enter image description here(Note that it propagates in full screen mode, status icons are highlighted and button floats are highlighted, and the z-index of the overlay is below the floated action buttons). I tried using the approach outlined in this StackOverflow question - However, once the overlay is displayed, it masks even floating action buttons and makes clicks. Has anyone tried this before and is sharing with you how it can be done? Thank.

+3


source to share


1 answer


Updated answer: To create a semi-transparent overlay effect, we can use the following style for the Activity:



<style name="BottomSheet" parent="Base.BottomSheet">
    <item name="android:windowIsTranslucent">true</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowBackground">@android:color/transparent</item>
    <item name="android:backgroundDimEnabled">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="bottomSheetBackground">@color/bs_background_dark</item>
</style>

      

0


source







All Articles