Translucent and Transparent Background for Activity
We are already familiar that an Activity in Android is a single screen on the device but in this article, we will learn how to make it transparent and translucent. 1. Open styles.xml and add the background theme. <!-- Background Theme for Activity --> <style name="AppTheme.NoActionBar.TranslucentBackground" parent="AppTheme.NoActionBar"> <item name="android:windowBackground">@color/colorBackgroundPromotions</item> <item name="android:windowIsTranslucent">true</item> <item name="colorPrimaryDark">@color/colorBackgroundPromotions</item> <item name="android:windowTranslucentStatus">true</item> </style> Set windowIsTranslucent and windowTranslucentStatus tags to true . As the name implies, windowBackground is the background color for an activity and is set to a custom color. Overriding the colorPrimaryDark will make the status bar tra