I am using a library called CookieBar2 (https://github.com/AviranAbady/CookieBar2). I am displaying a cookie bar at the top of the screen with this library:
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):
IMAGE1
Actually, I want it to appear like this:
IMAGE2
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).
Here is the image of this situation:
IMAGE3
What should I do? Can anyone help?
Arda is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.