I am using CookieBar2 to display a cookie bar at the top of the screen:
CookieBar.build(this@AppAdActivity)
.setTitle("TITLE")
.setMessage("MESSAGE")
.setDuration(10000)
.setBackgroundColor(R.color.app_blue)
.show()
However, the top part of the cookie bar is not fully visible. It might be hidden under the status bar, see the left image. I want it to appear as seen in the right image:
What could be causing this?
Here is my theme.xml
:
<style name="Theme.MyApp" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- Colors -->
<item name="colorPrimary">@color/app_blue</item>
<item name="colorPrimaryVariant">@color/app_bg_color</item>
<item name="colorOnPrimary">@color/white</item>
<item name="colorSecondary">@color/app_blue</item>
<item name="colorSecondaryVariant">@color/app_bg_color</item>
<item name="colorOnSecondary">@color/white</item>
<item name="windowNoTitle">true</item>
</style>
When I make the status bar color transparent like this:
<item name="android:statusBarColor">@android:color/transparent</item>
and add it to the theme, the issue resolves, but then after the cookie bar disappears, the status bar does not show (because the clock and other components are white, and the pages in the app are also white, so nothing is visible):
Arda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.